hi i have a little problem i export a web page html to a word document using php when just open the file all
captcha class you could use
i dont have pear installed
you dont need to
just download the class
pastebin.
lorl
is osnews.com yours?
Hmmm no? I’m just listening to a podcast from it.
cool
what can i use to recognize the first value in a hash?
err
key/value pair
He is discussing what is bloat
It’s interesting
$value) i want to get the $key only can i do that?
which one is it that creates the captcha that has the pretty swirly lines in the background
i dunno, theyre all the same
you know, like on the authentic windows manuals and stuff
loop through some letters, draw some pretty lines
hi…is there any other variable to store values in a session besides $_SESSION ?
http://rafb.net/p/uLNN4b97.html
Call to undefined function imagecreatetruecolor() in …captcha2.class.php on line 522
woot that captcha class is ugly
so…is there any variable that I can use instead of $_SESSION to store my session generated values?
eh?? you have a better one?
Hmmm.. No.
what’s wrong with $_SESSION?
It seems like you don’t have GD installed.
what is gd?
the server I hosted my page supports session…but I think it _SESSION doesnt exist
A php extension with functions to manipulate images.
here in my apache I use it normally…but when I hosted my page…bummmm….session vanished away…any idea?
What OS is your server running?
DARKGirl do a phpinfo(); and see if you have the gd library installed in there
unix
That’s worth investigating, since $_SESSION should always be defined, unless you’ve managed to build PHP without the session module.
i’ve never had trouble with session in the default install
did you try dumping it out?
Linux maybe? Do you know what distribution?
dump?
what is it like?
var_dump($_SESSION)
moment
what does it do?
Unix PHP 5, Apache 2
var_dump dumps out all of the values in a variable
for a hash it will dump out everything in the hash
its pretty handy for debugging
try adding “pre” when doing var_dump
it’s also helpful to do an echo “pre” ahead of the print_r/var_dump, just to format it logically.
….
any wiki parser libraries out there that someone recommends?
echo “pre”.print_r($array, true).”/pre”;
ok what is it called again?
GD?
good stuff, been wondering how to do what with var_dump though
looks for gd2 (in your php.ini maybe)
I don’t have any experience with Unix so I can’t help further.
*look
can always ob_start(); ob_getcontents(); ob_end_clean();
save as info.php and run that into your web server…
ForceFollow rather
and look at that file and check if you have GD installed
anyone else get php host to get itself in a tight loop and exhaust the memory in apache (and thus crashing it :/) when using SoapServer?
agentbob hmm ill check that out, it would be really nice to have for ajax stuff
I dumped session and it returned array(0) { }
i dont see gd2 anywhere
just after session_start()
gd2 or gd
one of them
neither
do you have any session variables set?
well that mean that you dont have GD installed
So $_SESSION is indeed defined.
$_SESSION['username'] = “me”;
i recommend if you have access to shh with root install it or contact your hosting provided and ask for it
wiki code rendering classes/libraries anyone?
what kind of webhost doesn’t offer gd? Surely it’s on there…
this is MY server
lol
I use session to store some data…but then when I load the same page again the data is gone…
I am hosting my own website
What kind of host runs Unix.. It’s propably a home server.
exactly
you can use http://captchas.net/ if you want
i rather install this GD
You probably aren’t calling session_start() on all the pages you use sessions.
what is the full name so I can search for it in google
linux?
Graphics Device?
what the heck is stdClss?!?!
linux?
DARKGirl = man.
Graphics Developer?
A featureless class built into PHP, used for various purposes.
please dont insult me EoN
this is not efnet
lol
linux? and what distribution?
THIS IS NOT LINUX
she said unix.
any way to turn one of those into a regular old array?
Sure, just cast it.
no girl has unix.
anywhere on the planet.
what the heck does that mean?
I’m afraid you’re mistaken.
$var_as_array = (array)$var
the problem is…hosting my page locally session works perfctly…but using another host it doesn’t….so..I’d like to know what is going on? it’s the same code….
I have OS C
X
lol
Well, Apple sells one variety.
oh..
OS X = Unix
darwin or something
OS X = bsd
aye darwin
Hey now, I’ll take OS X over XP/Vista any day.
unix destroys linux right?
unix destroys linux host right?
Why would it do that?
unix is a pretty general term. irix is a unix, irix is butt.
my problem is…hosting my page locally session works perfctly…but using another host it doesn’t….so..I’d like to know what is going on? it’s the same code….
i just got a MacBook and so far I prefer OS X to Ubuntu
eww ubuntu
unix is more likely to be used for high level absolute mission critical enterprise power-systems, than little toy linux afaik
linux more for ‘my little pony’ applications etc
Your information seems to be somewhat out of date.
root@kinkybox:~#aptitude purge EoN
uh, not so much
pass that doobie over this way.
thank you, that worked
Ten years ago, that might’ve been true.
Maybe.
cookies maybe, could be solar flares though
we’ve had a lot of those recently
can you write to the /tmp dir?
what are your php.ini session settings
what do you dislike about ubuntu?
here in my pc?
the Power of Freedom
sure, but preferably where it’s not working… as thats what you want to fix
sure, but preferably where it’s not working… as thats what you want to fix
*smells
so what is the full name of GD
how can I write in /tmp there using a file manager?
sessions are stored in /tmp by default
gd
maybe use a db session class
mmm, db sessions.
does phpinfo() tells me that?
gif draw
jennnny don’t change your number eight six seven five three ohhh nyyyyighne
which distro do you prefer?
should
kahotep the real one
Debian over everything
no some copy build on top of Debian
GD should be bundled with PHP 4.3 and later.
what part…session?
good place to start
heheheheh
I’ll take a look here…come back soon
not to flame every body have a diferent taste
especially me i dont like sudo here sudo there o you need administrator right to do this bah just use root and get over it…
Emacs sucks!
the sudo thing is good, imo.
bah i hate sudo
I’ve been using sudo for years.
imagick
make my command more longer
hardly…
well how do i get it to work with php
use imagick
so i’m guessing the “real” one is gentoo?
yea, sudo is annoying.. i’ve never had problems working as root all the time
‘all the time”?
everyone have they own taste and yes gentoo is really good
nevermind
but lack on installation like others disctribution
real one is slackware
took me about 2 hour to install gentoon on a imac 1999
“Hey Joe how it that gentoo box doing?” “Still compiling..”
*is
I used to love gentoo.
They’re quality control went to hell about 2 years ago, though.
wow has gentoo been around that long?
Their…
i haven’t used it since it was new…
i wonder what sup with caldera
heh @ foutrelis
i used it for a couple of years
quick way to print values in an array as a comma separated list, or am i stuck with a foreach loop?
about session…any problem if register_globals is off in phpinfo?
twas extremely fast
implode(“,”,$array);
dont tell me I have to recompile php
that’s so damn funny
was in context
Thanks!
sure.
about session…any problem if register_globals is off in phpinfo?
nope
no, register_globals SHOULD be off.
always
that is a huge security risk
I have a really dumb question. Ive been using a commercial php script and have been including some custom php files. Anyway, i just upgraded it and now my files arent working anymore because it cant find the files. I was including a file as so: include = ‘../path/to/file.php’; I switched to
include = ‘./path/to/file.php’;
Any idea what could have changed?
Session Support enabled Registered save handlers files user sqlite Registered serializer handlers php php_binary wddx
anyone??
probally the update erase your file or override it …
Two dots (..) refer to the parent directory while a single dot (.) refers to the current directory.
do I have to recompile PHP?
fkn skype has been down all day
yes.
i understand that, but all the paths are exactly the same as they were. Even the new files
There is an extra dot in the first path.
actually no, I lied. what was the question
Call to undefined function imagecreatetruecolor() in …captcha2.class.php on line 522
i understand that. Im just confused on what changed for the original path to not work anymore
what version of php? and does phpinfo() say anything about GD?
I don’t know anything about your script so I can’t really answer your question.
i dont see anything about gd in ther
and its version 5
http://www.php.net/manual/en/ref.image.php should be installed by default.. no –without-gd line at the top?
understand, cant think of a way to explain it. Something must be set differently in one of the encrypted files as all files/folders are in the exact same arrangement as the old version
i dont see –without-gd
Try using absolute paths in your include statements if relative ones don’t work.
Session Support enabled Registered save handlers files user sqlite Registered serializer handlers php php_binary wddx
you mean at the configure command?
yes
was a guess, might be something else
‘./configure’ ‘–prefix=/Library/PHP5′ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–sysconfdir=/etc’ ‘–with-zlib’ ‘–with-xml’ ‘–with-zlib-dir=/usr’ ‘–with-openssl’ ‘–enable-exif’ ‘–enable-ftp’ ‘–enable-mbstring’ ‘–enable-mbregex’ ‘–enable-sockets’ ‘–with-mysql=…mysql’
‘–with-mysqli=…mysql_config’ ‘–with-apxs2=/Library/Apache2/bin/apxs’ ‘–without-pear’ ‘–disable-cli’
look like gd is not enable on php.ini
is 3.1 == 3 ?
how do i enable it?
read installation http://www.php.net/manual/en/ref.image.php
it should tell you inside php.ini
ok
thank you
Ok, lets say i have a php file in /www/templates/bob/file.php
phew, it isnt, that’ll save some time
np
And i file in /www/templates/tom/file.php
oh no don’t do that. you NEVER want to have php files in /www/templates/bob/file.php
Lol, eh, i give up. Cant think of a good way to explain the circumstances
that is for windows only
hi example i have $array = (“1″,”2″,”3″,”4″,”5″); foreach($array as $values) if ($values) { iwant to end the foreach } –please help me
include(‘/www/templates/’ . $username . ‘/file.php’); ?
has both
hmm
ill scan again
first para… you need to recompile –with-gd
did you compile manually? or install pkg
hi example i have $array = (“1″,”2″,”3″,”4″,”5″); foreach($array as $values) if ($values == 3) { iwant to end the foreach } –please help me
manually
it sucks I have to recompile
no repeat.
sod that. im not recompiling
read carefully if it is a repeat.
heh
sod it. i don’t want to be a php programmer… i want to be… A LUMBERJACK!
$found = false; $i = 0; while( *$icount($array)) && $found==false ) { if($values == 3) { $found = true;} }
$found = false; $i = 0; while( *$icount($array)) && $found==false ) { if($array[$i] == 3) { $found = true;} $i++; }
and remove that * lol.
*$icount($array) ?
you know what i mean
heh
s/*/(
foreach($ar as $k=$v) if ($v == 3) return $k; ?
Does this make sense explaining my issue? http://pastebin.ca/660643
what is wrong with foreach?
check the manuals
../templates/tom/file.php relative to templates/bob/file.php is templates/templates/tom/file.php
Try include “../../templates/tom/file.php”;
.. refers to parent directory . refers to current directory. it will change dpeending on where you’re calling it from.
wtf
this fucking sadist
*shoots
Crap, i did that wrong
30 tracker items on my latest project
I mean my example
in one day
my client was busy
best way to do it is to define a root directory variable, and ALWAYS use that.
Correct it and post another link
Thats the way i had it
define a root directory variable (which points to the root dir of your website), and ALWAYS use that.
But there isnt a point of a root variable if its always relative
Just trying to figure out why my relative stopped working
the relative crap isn’t working out too well for you atm is it
I know, but it doesnt make sense why
define(‘ROOT_DIR’, ‘/var/www’); include(ROOT_DIR . ‘/templates/bob/file.php); etc
EoN i understand, but i shouldnt have to do it that way and can anyone see why my way isnt working?
it depends where you’re including the file(s) from.
(UGH)
cant I just make a collection of images on my computer and display them randomally and have the user type in the text that is in the image?
Maybe if that php file is included in another one then the relative path would be different from calling file.php directly.
Does anyone know of an PHP API for Aim … ?
would that be ok to do?
does “session.cache_limiter nocache nocache” impeds me from storing values in $_SESSION ?
that is something that I could prolly do easily in photoshop
1000 kittens pics
sure, or use text captcha
http://pear.php.net/package/Text_CAPTCHA
or use http://captchas.net
lorl
no, because their code i dont understand
im looking for a simple solution
http://www.ejeliot.com/pages/2
i’ve used that before
Does anyone know of an PHP API for Aim … ?
or you can just put ‘fake’ field in your form, use CSS to hide it. And if the field is FILLED IN, you can assume that it was a BOT attempting to submit the form.
because bots dont read css. browsers do.
better still put a few fields in
ahh that one might work because they go step by step on how to install it
that way’s nice because you dont havee the extra annoyance of having to fill out a captcha.
www.ejeliot.com
compare that install instruction with
www.captchas.net
recaptcha.
hmm, do you think I should use captcha on my login screen too?
_______ then on submit if($_POST['color'] == ‘blue’ || $_POST['color'] == ‘red’ || any other colour) { // NOT A BOT }
b_______ then on submit if($_POST['color'] == ‘blue’ || $_POST['color'] == ‘red’ || any other colour) { // NOT A BOT }/b
no
to prevent brute force attacks?
that would be annoying.
people hate captchas.
also, bots dont know passwords.
ok
requiring one for registration is one thing, don’t make me enter it every time I visit the site.
I didnt really want to either
lol
exactly
otherwise, I’m not coming back.
the hidden field way i described is PRETTY GOOD….
but if you’ve got a REALLY popular site, not rock solid.
And very simple I might add. Does it actually work?
The library requires PHP 4 compiled with GD 1 or 2 (Image Generation) and FreeType text support.
I cant use it
it works perfectly. unless someone develops a script to specifically get around it, it should be flawless..
because I dont have GD installed
but then if someone specifically tries, your’e screwed anyway
there HAS to be a way to hack GD in without having to recompile the damn thing
lol
did you read the hidden field method i described?
do you pay attention to anything anyone says except for yourself?
aahahahaha
i know what i’ll do. i will make a custom captcha using div tags and layers
digg.com has captchas even for comments
yeah, good luck with that. lol.
That sounds bloated
Does anyone know of an PHP API for Aim … ?
how is it bloated?
#url {display:none;}
bot thinks that’s a REAL field, fills it in… users dont see the field, dont fill it in.
its nothing but two layers using custom png images and a simple php randomisation script
divs tags layers
wtf is layers O_O
lmao
layer= z-order
yeah good one, let us know how you go with that.
hey guys just looking for a command to parse a php file into a variable without having to go to cli/use of exec/passthru ?
you dont know about z-order?
O_o
i used to use it all the time
ie. the php script echos and i want to capture all the output of the script into a variable
do you mean z-index ?
lmao.
flaccid, do you mean like get_file_contents?
same difference
except that z-order isn’t a css property.
nah like i want to parse an external php script into a local variable
ib
can i call a php function and specify the second paramenter without speciifying the first parameter? i.e. function x($a = 0, $b = 1) {} x(,5) ?
ob_start
this is true
No.
i mean unless someone would help me recompile php so i can get done already
i have worked ALL DAY on this one page
will they add that feature? the current way it works, if you have two optional parameters, and you want to specify the second one, you also have to sepcify the first one. it isn’t very practical :/
everything is done except one thing
the captcha
hidden field.
tell your function to do (or not do) something when you pass in a certain something
#url {display:none;} PHP: if($_POST['url']) { /* THIS IS A BOT, HANDLE APPROPRIATELY WITH ABUSE */ }
oh, like function x($a=0, $b=0) {if ($a==0) [specify a default]}… i suppose that works
how do I uninstall php
so I can re-compile?
just recompile, replace files after
replace files after?
http://www.phpmac.com/articles.php?view=184
i DONT want to miss anything so I wont have to do this again
?
(sigh)
how to check if a constant is set?
defined()
thank you
you use panther?
10.4.8
maybe it’d be okay, but this was written with panther
ah ha! I found the initial page that I used to install it
compiling php creates binaries, you then edit httpd.conf to use these compiled binaries (.so files)
http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x/
a href=”http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x/”http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x//a
a href=”a href=”http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x/”http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x//a”http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x/”http://switch.richard5.net/isp-in-a-box-v2/installing-php-on-mac-os-x//a/a
see
that list doesnt have –with-gd
Hi, Ive been working on a problem for 4 hours and was hoping that someone might be able to help me, I have a database set up by a program and it has a bunch of stored procedures in it. I am trying to use one of said stored procedures in a php function, basically its taking information out of a
seperate database and adding to to the one with the stored procedure. The problem is that I can’t get it to actually save anything in the data
what is the proper way to add gd?
I get the “returncode” as if it went through successfully but it isn’t in the database
here is my code ..
http://pastebin.ca/660673
try the manual page, php.net/image
what is -isysroot /Developer/SDKs/MacOSX10.4u.sdk” ?
what is the sound of one hand clapping?
(sigh)
hi
anyone here any good at regex? im trying to just leave a-z,numbers, and a dash (-) in a string. what is the regex for that? i know just a-z/numbers is ([a-bA-Z])
but adding in a dash doesn’t work
(sorry for nooby q)
hi
Test any one there
[a-zA-Z-]
have to add the dash at the end
hallo mr.ishara
yes
YES!!
a-z, not a-b
[A-z-]
lol it’s so annoying
thanks for help ealrier with regex
foutrelis, is it possible to check the status of the cdrom (open or not)? i’m trying to play a prank on my colleague’s box
I’m not sure.. Let’s find out
alags, that would be a client side script (javascript, vbscript or the like), and i think that only worked some years ago. pretty sure the functionality was turned off after widespread “use”
trix, client side script? awesome isn’t it possible to check through shell?
oh, via a distributable? maybe.. but i doubt it.
if i were going to go that route i’d just find a compiled exe for a php script to call
i’d really have to have a reason to use php though
i dont think alags meant through a webpage. where it cant be done
rather just a shell
or maybe not
trix, can you eject cdrom in php too?
it would eject the SERVER’s cdrom if anything.
lol
EoN, i didn’t mean through webpage.
i don’t think so. you can have php call an executable that does, though
Stupid drive.. it fully opens first and then closes.. pffft
EoN, oh, yes system() would do that!
exactly
lol
eject /dev/hdc; eject /dev/hdd
oh, this is cool
how to give password protection for pdf file through php code
what would be the best function to use to just check to see if a user inputted url actually exists but does nothing with it.
would just fopen and r be good enough ? or could it be insecure
fopen would be fine
you might also use snoopy and just get the headers
snoopy ?
http://sourceforge.net/projects/snoopy/
it’s a wrapper for curl
oh i dont want anything 3rd party
create password protected pdf file trough php – is it possible if any one has idea please help me out
just something like if ( url_exists() ) continue;
who wrote snoopy?
nice name.
it better be good to use such a good name
function url_exists($url) { if ereg(“^http://”, $url) return fopen($url, ‘r’); else return false; }
snoopy rocks if you’re doing a lot of http get/posts
i recommend it over streams in php but that’s after having used it for several years
(schnoo, if you used something like the above piece of code remember to fclose() the pointer)
error: GD build test failed. Please check the config.log for details.
i cant find config.log
find / -name config.log
that did nothing byt freeze terminal
It might take a lil bit
anyone want to help me figure out why php is crashing? this is the backtrace http://pastebin.ca/660648 and its caused by SoapServer, but i can’t figure out exactly what in my code is doing it
/usr/bin/ld: -L: directory name missing?
nevermind any errors
no im looking in the config.log right now
how to give password protection for pdf file . I am using fpdf class to generate the pdf file
conflicting types for built-in function ‘fabsf’
conflicting types for built-in function ‘floorf’
use a hidden field.
lol
\o/
or install Debian on VMware
doesn’t pdf have its own form of password protection
isn’t that the point of pdf
ill just try to compile again
Check this out: http://www.mamp.info/en/mamp.html
no. apache works without issue
Your php is on diet though
DARKGirl, your trying to use PHP on OS X? entropy.ch is the way to do it
hmmm I hate GD
Liquid-silence: Why is that?
use a proper distro
The pdf is generation on the fly and we are using fpdf class for generation the pdf
will tell you in a moment
I have image.php that has everything set so that its a image and I have code that does $im = imagecreatefromjpg(“read.jpg”); but when I do img src=image.php in another form the image does not show up
mamp should have gd2 installed and stuff I haven’t tried it but seems nice
program A is GPL, plugin B is sold. Does he need to open the code to public if he develops on B?
is this ##gpl?
Liquid-silence: A path issue maybe?
its relative
ok..
read.jpg is in the same folder as the script right?
yeah
and the html calling it?
techincally I never use GPL code in applications that is sold
its just wrong
initgroups failed: Operation not permitted
whoops
ignore that
heh
yeah it is
#linux-india
Liquid-silence: Can you pastebin the script so I may try it out?
can I pm?
sure
I used imagecopy() to write a small image into big image but the size of small image appears small on big image
imagecopy($img, $im,$x,$y,0,0,$width,$height);
My friend said to install the package on this site. www.entropy.ch
Is there is any reduction of size of image into other big images if we use imagecopy
what a weird redirect
Hmm, is it possible to return how many variables that are in an array?
what package?
DARKGirl, pick whatever you want, the guy running entropy.ch build apache for OSX, it has everything enabled, and can work with the installed Apache or can replace apache
s/build/builds/
My friend says http://www.entropy.ch/software/macosx/php/
csc`: count()
that returns a variable?
http://rafb.net/p/CZqQe511.html
anyone can help me out on this?
csc`: yeah. count($my_array); returns the number of elements in the array. 0 or more
alright, thanks
there were errors installing the software
Liquid-silence um…
hi this code is not working in firefox
span style=”FILTER: Glow(Color=#ff0000, Strength=8); width:200px;font-size:20pt;”Glow Filter/span
plz help
howdy doody
anyone in here have a sony vaio laptop, and still have your restore cds?
you are SURE I wont be able to hack in gd support on my current php install?
ScottMac__:
$format =& $xls-addFormat(); ?
it assigns by reference
thanks
(Sigh)
can someone help me configure capchas.net code to work with mine?
DARKGirl, nope, this channel doesn’t support 3rd party scripts
ill ask fourfivetwofour when he arrives
http://grulez.com/~foutrelis/img.php
dynamic puppy
hi all
hey indro
I want this string as array, but it has different whitespaces. any idea how to do that? is there a function for this?
circletestcoordinate550 120 20
hiya foutrelis
circle test coordinate 550 120 20
So you want to turn circletestcoordinate550 120 20 into circle test coordinate 550 120 20?
or the second string into an array?
no, I want array(‘circle,’test’,'coordinate’, 550, 120, 20)
the second string into array.
php.net/explode
yeah, but if I do explode(” “,$array) then it split only if there is one whitespace.
:O
hmm
$str = str_replace(‘ ‘, ‘ ‘, $str); first?
there are diffent lenths of whitespaces.
The first ‘ ‘ is two spaces
but I just found an idea in the last comment in php.net/explode.
To split a string containing multiple seperators between elements rather use preg_split than explode:
$str = str_replace(‘ ‘, ‘ ‘, $str); first? put it in a while loop with strpos(double space)
preg_split (“/\s+/”, “Here are to many spaces in between”);
that seems what I want.
yay
or that
thx anyway.
can you give the source of your dynamic image?
I need to draw a circle on a image.
or a good doc?
I have y and x and want draw a circle there on a image.
This might do it
http://gr2.php.net/manual/en/function.imageellipse.php
thanks!
http://grulez.com/~foutrelis/img.php
circle on puppy
lol. ^^
Hmm, anyone know of a game that uses bittorrent to download their installer and run?
and the code is at http://grulez.com/~foutrelis/img.phps if you’d like to take a look
thank you, will help me.
or what that software is called.
np
What would be the equivalent of wget in php?
this is ##php and that sounds illegal
it is?
hmm
wonder if i can sue Blizzard and Flagship studios for this software
http://www.zend.com/tips/tips.php?id=91&single=1
We have “ in PHP? O_O
thanks mace
Mace[work]: I’ll take your legal advice and go sue blizzard for their bittorrent usage
You can load files from a HTTP URL using fopen()
Look at fopen wrappers in the docs for more information
meow ok
foutrelis, how did you syntax-colourize your code @ http://grulez.com/~foutrelis/img.phps ?
from a general perspective. Should I allow people to use passwords less than 6 characters?
what’s the normal range?
The server must did it automatically.
foutrelis, great.
Just add AddType application/x-httpd-php-source .phps to your apache configuration
foutrelis, oh, good. thanks for the tip
np
hey friends
What’s the easiest way to remove all punctuation from a string?
hello rick111
is there a way a can see all the communications between my broswer and server, for example all the ‘mod rewrite’ requests etc, without sniffing packets?
except space and ‘,’
maybe some online tool?
6 characters _minimum_
that’s what I have now
letters, numbers, AND puncuation
I just allow everything
require those things
no
I don’t know what I can do
without actually typing all of the characters
looks like i’ll have to do that
ok thanks guys
oh, is there a regex replace in JS you could use maticode?
preg_replace with “/['.,!?]/”
exactly
what about unicode characters Mace?
you said punctuation
you could use “/^[a-zA-Z0-9]/” and _only_ allow those characters
“/[^A-Za-z]/”
whoops
I suck at regex
I want to allow space
nop, typo’ed
“/[^\sa-zA-Z0-9]/”
was I right then?
ok thanks mace i’ll try that
Mace[work]: oh, i figured why you thought I was talking illegal stuff
Mace[work]: the installer of an application IS a bittorrent client that downloads the installer fromt he net to run at a later time
i see
Mace[work]: sort of how a small sized instalelr downloads a 200mb installation files to run at a later time
on the topic of regex… “[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?” that won’t work… it allows foo
managing the download and all
sorry for seeming somewhat “riskey”
s’ok
I’ll figure this out, I took it from the regular-expressions.info site for e-mails
Don’t use such a complicated regex for validation emails
There really is absolutely no point
fopen with fread and fwrite works very nice Thanks
what if i want to replace all commas with spaces?
Instead of fread / fwrite, you could just use copy() to download a file to a temporary location for example.
MarkR42, what one do you reccomend?
I’m just checking for simple mistakes
any girl ?
how could I strip a line break in a string of HTML output?
Personally, I use /^[a-z0-9_\.\-\&]+@[a-z0-9][a-z0-9\.\-]+\.[a
-z]{2,5}$/i
Oops that got broken up
We use /^[a-z0-9_\.\-\&]+@[a-z0-9][a-z0-9\.\-]+\.[a-z]{2,5}$/i
Which is hopefully simple enough that you can understand it
This is what I ‘m doing http://grulez.com/~foutrelis/wget.phps (kind of stole it from a comment at php.net/fopen)
we’ve found that it will match most valid emails, and will not match things which are obviously not valid emails
I only understand and write simple regex. It’s been a while since I’ve actually wrote a complex regex statement
nm
And that regex seems to give a good balance of complexity / accuracy
thanks guys, later
oh one last thing, how do you turn multiple spaces into a single space
MarkR42, looks good. From what I can tell it allows IP addresses
copy() should work.
Allows IP addresses? like x@127.0.0.1 ? certainly not.
Just copy(‘http://some_url‘, $file) ?
\s+
Yep.
I read it wrong I guess…
thanks
may not be the most direct solution, but nl2br the string and remove br tag, otherwise you’ll be forever removing variations of \r\n (i know of no better way)
i don’t think there is an identifier such as EOL in preg_replace
PHP5.2.4 ?
apache2.2.5
anybody alive ?
no
is there something similar than wget -N in php?
exec(“wget -N url”) seems not working. :/
You can open URLs using fopen
read the docs about http wrappers
-N checks if the remote file is newer than local file.
perhaps means you don’t have access?
where can I check that?
exec is probably disabled for security reasons
exec(“pwd”) works..
su [user_name_of_what_php_runs_as] | wget -N url
ok then it’s not disabled
in ssh
hi
hey maxagaz
Mace[work]: it saves the file but after that I get su: Authentication failure
login as root
hi
hello all
Mace[work], thanks for the help btw
Maybe the user indro uses to login in with ssh is different from the one apache uses
forgot to say it before darting off to bluefish
oh rly? i re-read and thought it wouldn’t work, aren’t you removing the br /’s from the HTML?
actually I just used the str_replace(“\n”, ”, str_replace(“\r”, ”, $content))
im not looking for the brs, just the line breaks in the code itself
im chasing some x-browser display issues
ty tho
oh ok, cool – np!
Mace[work]: I get the messsage not anymore as root.
but it doesnt save in current dir?
you’re doing su to change users
yes
you are trying to see if php has access to perform the action
when you’ve su’ed and it works come back
##linux
it works, but I see the file not in current dir.
so the question is where it saves the file.
do “updatedb” then “slocate [the file]“
is there a function to get all files in a dir as a array?
there is in php5, search the manual
hi
will there be a su feature in php 6?
k, thanks.
Who knows. I’m not sure what a “su” feature would be or be used for
what kind of idiot base64 encodes database records?
Someone who doesn’t know that BLOBs exist ?
php6 ?
even seen PHP Object Generator? egads.
have you used php6 ? super
OMGOMGOMGOMG
i fixed it!
finally
cool.
i went on the captchas.net site and forced myself to understand the code
LOL
and…it actually worked
how did you forced yourself?
well, I removed all the nonsense comments and adapted it to my code
and it wasnt that hard actually
my user registration page is COMPLETE!
girl ?
MarkR42 like the suphp thing
Dark
Well, you can use PHP6 yourself if you take it out of CVS and build from source
no , php6 is not a suprising version
i like php5 + eacc
php5 + eAccelerator
DARKGirl
yes?
are you using php ?
surprised, even have no girl hear of php
you can’t have been paying attention really
hello
is there any other possibility to recognize a website visitor beside his IP address ? i would like to recognize a user if he enters the website multiple times even if he’s using a dinamic IP address, is that possible ?
cookie
hmm, i’m not very familiar with how cookies work, is there anything to read about this ?
i mean, some tutorial or something ?
http protol
http://www.php.net/manual/en/features.cookies.php
http://en.wikipedia.org/wiki/HTTP_cookie
thank you enobrev
hi, i have a little problem, i export a web page (html) to a word document using php , when just open the file all the images are in the word document but when i save it or just save the file instead of opening it all the images are gone, i think this has something to do with adding certains
headers to the html file???
tag.
blabla.php?var1=value1&var2=value2 correct??
amperstand being the divider
say i have a string
yes
stroop is there a way to give them with the file so they are in the document
“i have a string”
“,1,2,3,4,5″ and i want to remove only the first comma….how would i do that?
…lol
didn’t mean to hit enter…_
[domon]: ltrim
it’s right next to “
the string has ” in it?
rza, for some weird reason, my 2nd variable is not being passed along
nah it doesn’t have quotes in it
how are you accessing it?
[domon]: ltrim( $string, “,” );
thx
do I need php5 for imagecreatefrompng?
I don’t think so- you just need a version which supports that, that’s all
rza, well, i have a condition include… the thing is that it’s being reset to the default-if-not-set variable all the time
rza, and an echo shows it clean
var_dump( $_GET );
check the manual
png» http://www.libpng.org/pub/png/libpng.html Only supported in GD versions greater than gd-1.6.
So I need just a new gd version?
or also a newer php version than 4.4.4?
why dont you install php5 ?
because I have a application running under 4.4 that should be working.
it doesnt work under 5 ?
dont known, how high is the risk that it doesnt work?
php5 will meet a lot of probs
fifty sixty
such as oop
depends how well it was coded
I dont used oop…
so it might work?
there is a good chance it will work out of the box
just setup a test env
because php4 is dead and it will be even more dead soon
not easily.
hm, I could do a snapshot..
server is a in a vmware infrastructure..
okay, I think I will update then.
php.net
see the top news
php end of life has been announced
Well, porting all your applications to PHP5 should be high up on your list, if you plan on maintaining them at all
k, good to known.
Porting an app from 4-5 is not straightforward, you will obviously need PHP4 and PHP5 test environments in order to do the necessary engineering
morning guys
i have a little case… which is not quite unerstood. if anyone can check it: http://pastebin.com/d101904b0
hey guys quick question
if i want to download 10 images that are in an array what is the fastest way to do it, curl, fopen or something else ?
Nir-PHP, you need to use str_replace instead of explode
explain please
explode devide them to array.
str_replace..?
datarecal, foreach cycle and curl or system(“wget …”);
Nir-PHP, why does you need to divide them?
since it would be lot easier for me
just parse your string and change “” to “”
aibo which one would be less intensive or faster ?
no no..
datarecal, system(“wget…
i’m trying to build something
devide is kinda nessecery
ok thanks
is there a way to keep the devide?
Nir-PHP, i don’t understand you
can i pm you?
try
it doesn’t load my images but it does when I I type img src=”Help Images/viewVes1.jpg” alt=”View Vessel Screenshot” /? Both images exist.
you can’t use .tif files I think
use %20 where there are spaces
2secs
oh yes I didn’t see that
and still nothing
*.jpg and *.gif decrease it dramatically
afayk, is ctype available on /most/ php distros?
.png
but don’t expect to have a small size
sure lol
there are some lossless jpeg flavours too, but they aren’t widespread
thank you .Png works and its about 4kb. fie with me
thanx again
i thought there were losless gif’s
+s
Moin!
I’m reading a ldap entry with ldap_read and getting an error on stderr of the fastcgi process if the dn does not exist
Why does it return the error message on stderr and not just return FALSE?
This seems unpractical…
Ah, to be honest i get a php Warning
But i check the return values of ldap_read and it would be totally normal for the dn to don’t be there, so i would be a lot more happy if that wouldn’t write into my logfiles
C3245728_10.jpg what is the best way to extract the number after _ but before .
so in this case 10
hi, has anyone used APC here?
hi
hi, has anyone used APC here?
I have $stripped=”htmlhead/headbodythis is an html fileand i am replacing letters “a” for “b”./body/html”; how can I replace letters “a” for “b” in the text that the user would see in the browser?
can I put a 1 second pause in my php script using a php function?
or even half a second?
obyone, why don’t you try to create a template like {{a}} and give a str_replace ?
sleep()
thanks
i think i need preg_replace_callback
preg_replace() would work fine
function A2B($matches) { return $matches[0].$matches[1];}
$stripped = preg_replace_callback(“/([^]+)/”,”A2B”, $stripped);
these two lines are the code I am making for it
the second line is perfect, but the first one, in the function i don’t understand what i need to put
$stripped = preg_replace( “/\\\”a\\\”/”, “\”b\”", $stripped );
Artnez $stripped remained unaltered after that
and withdraw the data within them as a variable. For example namethomas/name.
nope, the regex works, i just tested it
here’s the test http://pastebin.com/m17e51b0f
http://us3.php.net/xml
Hi, I have strange problem with my understanding of transaction in php AdoDB extension. I’m trying to do this startTrans; valid query; invalidquery; endTrans. But It does valid query too.
there are various other libs available that either make use of that or dont, just google
uff, i think i’ve been inaccurate
Hello Artnez, I had a look at XML. I found it on my googling… I tried all the examples but I don’t seem to understand how to grab infomation from the XML file?
my intention is tu change all letters a for letters b in $stripped=”htmlhead/headbodythis is an html fileand i am replacing all the letters a for b./body/html”;
read more
The examples seem to just output the XML and some echos.
One had a PHP version aswell
so i have an apple would become i hbve bn bpple
)
I’m afraid I did… Maybe a clue? A keyword?
Hi there everyone
Hi, I have strange problem with my understanding of transaction in php AdoDB extension. I’m trying to do this startTrans; valid query; invalidquery; endTrans. But It does valid query too.
“This example maps tags in an XML document directly to HTML tags. Elements not found in the “map array” are ignored. Of course, this example will only work with a specific XML document type. “
Am I warm?
preg_replace( “/a(?=[^]*)/”, “b”, $stripped );
You are using MySQL ?
da
Do you have access to the configuration of MySQL ?
si
There is an option to turn on a query log, this will help you a lot during debugging queries and this sort of situations.
aaaaa
it’s overkill
And could you show us some code of the code section ?
sure
Production machine ?
http://pastebin.com/m27c8e3e3
no, but i will debug mysql for hours to find one problem in my code, you know
Your code looks sane at first, can you step into those methods on the global $db ?
Artnez $stripped=”htmlhead/headbodythis is an html fileand i am replacing all the letters a for b./body/html”;
but anyway, i think it will work fine anyway
it’s just $db-Connect($db_address,$db_username,$db_password,$db_database);
I meant if you can view the things that are done in StartTrans() for example.
Could I ask if you have experience with adodb and transaction or just try? no offense. Code looks sane for me too, but I think i missunderstand adodb transcations
MyISAM tables or InnoDB btw ?
default one
Check if they are MyISAM please
i’m not mysql guy
Otherwise transactions will not work ..
ADODB relies on transactions on the database backend
ok. just give me minute to google how to do it
phpmyadmin installed ?
ok.
hi all – has anyone here designed an online shop from scratch and made it generic but still very detailed to allow the shop owner to sell lots of different products with different specifications with no modifications to code or am I dreaming by attempting this
i got it. show tables status; – MyISAM
You will need to change the storage engine (this is what they are called) to InnoDB then.
Or maybe even some other storage engine.
MyISAM doesn’t support transactions ?
This may be a bit offtopic. I’ve developed a website where I have by mistake mixed up the character encodings of the files. Some are utf-8 and some are iso-8859-1. Is there a windows application out there that can convert all my files to UTF-8?
Nope, it doesn’t
so problem is solved, thanks
Good luck with it!
create table test (id int) type=InnoDB;
how do you out an array like this?
test['1']
out an array ?
You want the value of the index 1 ?
Sorry, how do I use an array. For example within it I have the a value called ‘1′… I want to echo it.
prints 1
There is a large section about howto use arrays on php.net.
Perfect thanks
http://php.net/manual/en/language.types.array.php
same result with InnoDB
Oh awesome, that is massive. I’ll start reading!
Have fun!
It isn’t ?
I don’t kown
Me neither. ;/
You know what, I have an array ’stuck’ inside a variable.. how do I help i’m excape?
This is the output of the variable:
http://www.netstra.net/muz/test3.php
Odd. Could you check on every execution of a query if it fails or is going like normal ?
how do you what?
btw that invalid query return exception with 1062: Duplicate entry ‘2′ for key 1 – probably I can’t catch stuff like that with transaction and write a lot more complex code
Basically I’ve got XML data being converted into an array. But i’m left with a variable that outputs: http://www.netstra.net/muz/test3.php .. I want to know how I can get data from within that array. For example ech ‘Test Text’
what happened to reading that link ….
read it, and you’ll know how
Thats fine, Its just my array is stuck inside a variable
It’d be fine if I created a normal PHP array.
Ok. So we know the problem again.
but anyway, When execption is throwen, It will never reach CompleteTrans and no change should be written
go and read up on arrays, you can’t have an array “stuck inside a var” – I don’t even truely know what you mean by that
I guess you should check for error and rollback the transaction then.
Did you see the output on that page: http://www.netstra.net/muz/test3.php
yes I did
sounds good
Or use some sort of try, catch if adodb supports it.
:-[
I can't do echo $myarray[1] it outputs ‘Array’…. Although I wanted it to output Test Text…
yes try-catch-rollback
so go and read that link and all will be explained
I thought the problem might be with the array coming from converted XML.
PHP5 application ?
Good evening.
yes, but addodb’s documentaions say CompleteTrans() detects when an SQL error occurs, and will Rollback/Commit as appropriate.
So its definatally not an XML problem?
no, it’s a person not reading the manual, problem
Sidenote: Read something about globals btw, and think about a DB singleton or Registry class.
Oh, so its an array problem
Okay thanks
Odd, but like I said I don’t know AdoDB that much. Maybe you can step through the code in the CompleteTrans method.
To see where things go wrong.
Too bad you have to digg in this deep then.
no, it’s not an array problem, the problem is that you are not reading the manual page you were linked to that will explain everything you need
Nice CMS
thanks!
That manual is for arrays?
I need to get MySQL working with PHP
$value=rand(0,3); will mave $value be 0, or 1 or 2 or 3 ??
http://php.net/manual/en/language.types.array.php
did you even look at it?
I have no idea where to start.
0, 1, 2 or 3
I’m on Kubuntu Feisty Fawn.
Google for documentation
so random from 0 to 3 both included
Thanks!
thanks for your help anyway! what’s wrong with that global? Do you mean it would be better to wrap it in class or something else?
apt-cache search php / mysql-server-5.0
Yep, and I suddenly understand everything. As you said :p
Thanks.
yes, since php.net/rand states it’s the min and max value
AlexC_ yes but have a look at the first example
Are you doing Object oriented programming ?
what about it?
This is multiparadigm program. But I do OOP in OOP languages.
hold on, it may be between those values not including
but It has been just thought how to avoid that global.
Ok. You know about singletons and registry pattern then ?
the manual contradicts it’s self a bit there!
singleton – ofcorse. but not sure about registry.
AlexC_ rand(5, 15);
gives
Hello all
7771ç
please advise good SQL constructor for PHP
nothing returned
something like SQLObject for Python
it says “A pseudo random value between min (or 0) and max (or RAND_MAX, inclusive).” which makes me belive it will return a number _between_ the numbers you give it. Yet, the paramaters say “The lowest value to return (default: 0)” which tells me that the values you give could be returned
php -r “var_dump( rand(5, 15) );”
int(15)
http://www.phppatterns.com/docs/design/the_registry
looks like it does return the values you give it
s/does/can
Exactly your situation is described
http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#PHP
AlexC_ before using rand should i use something else like srand in C++ ?
system(“/usr/bin/wget -P $outputfolder $inputaddress”);
there is no need afaik
brb, lunch
“Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically.”
well i do $value=rand(0,3); and then i have $value in a switch with cases 0,1,2 and 3 and it always picks case 3
then you didn’t put breaks; in your switch statement
php.net/switch
i did
pastebin the code
i know it is the easiest to forget
but this time i did
pastebin the code
do above the switch, var_dump( $value );
what’s that?
here?
it will show what is in $value
rza, yeah
http://phpfi.com/256754
can you test that on windows
results a black image here
so
(ie whole last night at home)
what about simple ORM for PHP+MySQL
?
transparency seems to be broken
it happens with imagemagick 6.3.3
hi
i dont know if that is fixed in later versions
if you can compile against the latest it would be nice
AlexC_ and an echo ??
huh?
to see the value
just do var_dump( $value ); like I said
hi there
i’m using PHP mail but it’s just failing silently
mail()
are there any settings that i need to check in the php config files to fix it?
i’m using IIS on win2k3
do you have a smtp server installed?
yes, i do
AlexC_ i get written NULL
have you configured the smtp settings in php.ini?
rza, I can confirm it
i don’t know
re-pastebin the code
but can’t do anything until I get home
i didn’t setup php
i’ll check php.ini
yup, looks like an imagemagick bug to me
or a problem with edinks build
how to open some url in php, bud not with fsockopen()
AlexC_ the code is very simple anyway, it this was C++ y would be suspecting that i need an srand or something…
http://pastebin.com/m5f952ee3
http://uk.php.net/manual/en/ref.curl.php
and you get null? what php version?
4 i think
go and check,
thanks
rza, i’ve made sure that php is looking at the right place for the smtp server
but no email came
are you sure the email server is sending it?
Sweet!
rza, yes, i am
infact, i just checked the smtp servers logs
i’m getting “sender must be specified” for some reason
despite the fact that it is
You know how theres some chars that stuff up PHP… for example… ” and ‘… is there a way to automatically remove this from a variable.
“stuff up PHP”Q
i dont understand the term
I think Thomasporter has his own terms for everything
he probably means magic_quotes_gpc
Thats it.
Thanks, forgot what it was called.
i think Thomasporter wants a lesson on escape codes
Lack of sleep I blame it on!
Is magic_quotes_gpc really get_ magic_quotes_gpc
Can’t find the manual..
you dont want to use it
look in php.ini and turn off magic_quotes
anyway, food o’clock for me – tada
How else can I add escape codes without manually typing them without magic_quotes?
http://au.php.net/manual/en/function.stripslashes.php
usually you want to escape only the data that is going to a database
and you also want to do some validation / other cleaning for the data also
trying to do this automatically can lead to errors such as XSS
This is just for a client-side PHP script, its only doing it to a XML file that isn’t controlled by the user.
client-side php script?
how does a client -side PHP script work?
Yes, aweful wording.
write a php parser in javascript
Oops.
google gears
Its going in a box that hasn’t got a internet connection. Its only accessable via LAN.
hi, I want to pass $get variablesh to other url via curl, bud i don’t know how to handle whitespaces
htmlenitites…?
when I get some variable with whitespace… somethig goes wrong
Its E_ALL for error reporting right?
like www.example.com?var=blah&othervar=this and this
What goes wrong? Whitespace is represented with %20% or something like that I can’t remember.
But its perfectly normal.
%20
does xhtml works in IE ?
don’t know… in my php i try to open $url = “http://www.example.com?var=”.$myvar;
to extract links like this from a html file should I use some sort of html parser? regex? a href=”link”August 15: Description/a
where $myvar = $_GET['text']
when i’m opening this url directly through webbrowser… evrything is fine, bud from curl in php, won’t work if var had whitespace
it seem that curl can’t handle whitespace in url!
Can’t just use %20 in your scripts?
i must replace evry space in my var with %20
error_reporting(E_ALL);
url_encode
what should I use to parse links like this in a html document? a href=”link”August 15: Description/a
preg_match()
envp so i don’t need a html parser?
what you going to to with that link ?
*to do
i want to store link and description
prem_match()
preg_match() / sorry
google it
first etc
preg_match + parse html
$price) { if ($level=$_POST['value]) { return $price; }} but i have a problem for instance if they enter 65000 it returns 110 but if they enter 120000 it returns 130 but i want it to return the one past the level so if they enter 65000 it will return and if they enter
no, only that what intresting you
what did you mean by “parse html”
hello good people.
that would imply people here are good, when in fact, most of the questions and comments here tend to lean toward the contrary.
But hi
Hi
InsolentDreams omg
been a long day, hehe.
huh.
Query a mysql database in php the query works fine in the command line but php says the query is invalid and dose not get the results BUT i take the query straight from php (i print out the query and copy it into the command line….)
It’s been a long day, for me.