RE: [PHP] mysql input

2008-02-18 Thread Robert Cummings
On Mon, 2008-02-18 at 23:19 -0500, Bastien Koert wrote: > mysql_real_escape_string() > addslashes() > htmlentities() > > take your pick That's a bad answer. If he's using MySQL then he SHOULD use mysql_real_escape_string(). None of the other functions will fully protect him from malicious input

[PHP] Re: mysql input

2008-02-18 Thread Shawn McKenzie
nihilism machine wrote: > I have a user saving a VARCHAR(255) field in a mysql db which has single > quotes in the text, how can i replace them so that they dont fuck up my > mysql command? > > -e Have you tried: dont_fuck_up_my_mysql_command() -- PHP General Mailing List (http://www.php.net/

RE: [PHP] mysql input

2008-02-18 Thread Bastien Koert
mysql_real_escape_string() addslashes() htmlentities() take your pick bastien > From: [EMAIL PROTECTED]> To: php-general@lists.php.net> Date: Mon, 18 Feb > 2008 23:05:10 -0500> Subject: [PHP] mysql input> > I have a user saving a > VARCHAR(255) field in a mysql db which has > single quotes

RE: [PHP] More than one values returned?

2008-02-18 Thread Bastien Koert
return an array bastien> From: [EMAIL PROTECTED]> To: php-general@lists.php.net> Date: Tue, 19 Feb 2008 10:31:02 +0900> Subject: [PHP] More than one values returned?> > Hi,> > > Is it possible to "return" more than one values in PHP?> > return $x;> return $y;> > They don't work for me.> > -T>

Re: [PHP] mysql input

2008-02-18 Thread Robert Cummings
On Mon, 2008-02-18 at 23:05 -0500, nihilism machine wrote: > I have a user saving a VARCHAR(255) field in a mysql db which has > single quotes in the text, how can i replace them so that they dont > fuck up my mysql command? mysql_real_escape_string() Cheers, Rob. -- .--

[PHP] mysql input

2008-02-18 Thread nihilism machine
I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] More than one values returned?

2008-02-18 Thread Robert Cummings
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote: > On Monday 18 February 2008, Nick Stinemates wrote: > > > >> I have found, however, that if I ever need to return /multiple/ values, > > >> it's usually because of bad design and/or the lack of proper > > >> encapsulation. > > > > > > You

Re: [PHP] More than one values returned?

2008-02-18 Thread Larry Garfield
On Monday 18 February 2008, Nick Stinemates wrote: > >> I have found, however, that if I ever need to return /multiple/ values, > >> it's usually because of bad design and/or the lack of proper > >> encapsulation. > > > > You mean you've never had a function like getCoordinates()? Or > > getUsers(

Re: [PHP] More than one values returned?

2008-02-18 Thread Robert Cummings
On Mon, 2008-02-18 at 18:29 -0800, Nick Stinemates wrote: > Robert Cummings wrote: > > On Mon, 2008-02-18 at 18:06 -0800, Nick Stinemates wrote: > > > >> C.R.Vegelin wrote: > >> > >>> >>> $in = 4; > >>> calcpows($in, $pow2, $pow4); > >>> echo "in = $in pow2=$pow2 pow4=$pow4"; > >>> > >>>

Re: [PHP] More than one values returned?

2008-02-18 Thread Nick Stinemates
Robert Cummings wrote: > On Mon, 2008-02-18 at 18:06 -0800, Nick Stinemates wrote: > >> C.R.Vegelin wrote: >> >>> >> $in = 4; >>> calcpows($in, $pow2, $pow4); >>> echo "in = $in pow2=$pow2 pow4=$pow4"; >>> >>> // define return fields as &$... >>> function calcpows($in, &$pow2, &$pow4) >>> {

Re: [PHP] More than one values returned?

2008-02-18 Thread Robert Cummings
On Mon, 2008-02-18 at 18:06 -0800, Nick Stinemates wrote: > C.R.Vegelin wrote: > > > $in = 4; > > calcpows($in, $pow2, $pow4); > > echo "in = $in pow2=$pow2 pow4=$pow4"; > > > > // define return fields as &$... > > function calcpows($in, &$pow2, &$pow4) > > { > > $pow2 = $in * $in; > > $pow4

Re: [PHP] More than one values returned?

2008-02-18 Thread Nick Stinemates
C.R.Vegelin wrote: > $in = 4; > calcpows($in, $pow2, $pow4); > echo "in = $in pow2=$pow2 pow4=$pow4"; > > // define return fields as &$... > function calcpows($in, &$pow2, &$pow4) > { > $pow2 = $in * $in; > $pow4 = $pow2 * $pow2; > } > ?> > > HTH > Thats a good example, and a good reason for p

Re: [PHP] More than one values returned?

2008-02-18 Thread Larry Garfield
On Monday 18 February 2008, Teck wrote: > Hi, > > > Is it possible to "return" more than one values in PHP? > > return $x; > return $y; > > They don't work for me. > > -T A function always returns a single value. That value can be an array. function foo() { return array(1, 2); } list($a, $b)

Re: [PHP] More than one values returned?

2008-02-18 Thread C.R.Vegelin
HTH - Original Message - From: "Teck" <[EMAIL PROTECTED]> To: Sent: Tuesday, February 19, 2008 1:31 AM Subject: [PHP] More than one values returned? Hi, Is it possible to "return" more than one values in PHP? return $x; return $y; They don't work for me. -T -- PHP General Ma

Re: [PHP] More than one values returned?

2008-02-18 Thread Brady Mitchell
On Feb 18, 2008, at 531PM, Teck wrote: Is it possible to "return" more than one values in PHP? Yes, in the form of an array. return $x; return $y; Only one return statement can be used. http://us.php.net/manual/en/functions.returning-values.php Brady -- PHP General Mailing List (http://

Re: [PHP] More than one values returned?

2008-02-18 Thread TG
You can't return more than one variable, but you can return an array that contains multiple values. $x = array('val1', 'val2'); return $x; -TG - Original Message - From: Teck <[EMAIL PROTECTED]> To: php-general@lists.php.net Date: Tue, 19 Feb 2008 10:31:02 +0900 Subject: [PHP] More

[PHP] More than one values returned?

2008-02-18 Thread Teck
Hi, Is it possible to "return" more than one values in PHP? return $x; return $y; They don't work for me. -T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] classes

2008-02-18 Thread Shawn McKenzie
Nick Stinemates wrote: > Shawn McKenzie wrote: >>> What part of my example was unclear? >>> >>> >> All of it, since I posted just a couple minutes after you and I hadn't >> seen your post yet. >> >> > I'm sorry, I thought were were responding WHAT?!? to me. > > I'm going to blame thunderbi

[PHP] Re: Fwrite Function

2008-02-18 Thread Dan
If that's really your code then your script is going to get abused in no time. It's important to sanatize any user input before just writing it to a file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: open a secondary window/tab in the browser from php

2008-02-18 Thread Dan
"julian" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I have an application that along filling in some forms, it produces a pdf file, as confirmation of all entered data. I want to send this pdf file to a different window/tab of the browser, so it is displayed and can l

Re: [PHP] classes

2008-02-18 Thread Nick Stinemates
Shawn McKenzie wrote: >> What part of my example was unclear? >> >> > All of it, since I posted just a couple minutes after you and I hadn't > seen your post yet. > > I'm sorry, I thought were were responding WHAT?!? to me. I'm going to blame thunderbird for looking like you responded to m

Re: [PHP] classes

2008-02-18 Thread Shawn McKenzie
Nick Stinemates wrote: > Shawn McKenzie wrote: >> Jay Blanchard wrote: >> >>> [snip] >>> if i declare an instance of a class in the top of my php file, then >>> have html, then later on user $myClassInstance->myMethod(); -- >>> myMethod() does not execute, only when i have the instantiation

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Shawn McKenzie
In your php code you'll need the full path to biblioteca.php and to t.zip and the web user will need write permissions to the dir where you create t.zip. -Shawn Petrus Bastos wrote: > Wolf, > > I'm sure actually working from the command line. > > > /usr/local/bin/zip -P t.zip biblioteca.

RE: [PHP] classes

2008-02-18 Thread Jay Blanchard
[snip] > http://www.php.net/flush Huh, what?!?! to both of you: [/snip] My bad...I had a total brain fart and 'combined' some concepts that I was speaking to someone about off-list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Stut
Petrus Bastos wrote: system("/usr/local/bin/zip -P t.zip biblioteca.php",$ret_val); Try a full path . here - ^&^^ that's my code and even zip with full path, return $ret_val = 127; AFAIK that's the error code for "command not found" which probably means PHP

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
I've tried without success... system("/usr/local/bin/zip -P /.automount/ipojuca/export/homeg03/golapa/public_html/mapdenguepe128/site/php/biblioteca/t.zip /.automount/ipojuca/export/homeg03/golapa/public_html/mapdenguepe128/site/php/biblioteca/biblioteca.php",$ret_val); On Feb 18, 2008 7:16

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Results the same thing. On Feb 18, 2008 6:59 PM, Wolf <[EMAIL PROTECTED]> wrote: > > Petrus Bastos <[EMAIL PROTECTED]> wrote: > > system("/usr/local/bin/zip -P t.zip biblioteca.php",$ret_val); > > > > that's my code and even zip with full path, return $ret_val = 127; > > > > On Feb 18,

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
I've tried. returned Array ( ) 127 On Feb 18, 2008 6:58 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Feb 18, 2008 4:55 PM, Petrus Bastos <[EMAIL PROTECTED]> wrote: > > system("/usr/local/bin/zip -P t.zip biblioteca.php",$ret_val); > > > > that's my code and even zip with full pat

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Wolf
Petrus Bastos <[EMAIL PROTECTED]> wrote: > system("/usr/local/bin/zip -P t.zip biblioteca.php",$ret_val); > > that's my code and even zip with full path, return $ret_val = 127; > > On Feb 18, 2008 6:43 PM, Wolf <[EMAIL PROTECTED]> wrote: > > > > > Petrus Bastos <[EMAIL PROTECTED

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Daniel Brown
On Feb 18, 2008 4:55 PM, Petrus Bastos <[EMAIL PROTECTED]> wrote: > system("/usr/local/bin/zip -P t.zip biblioteca.php",$ret_val); > > that's my code and even zip with full path, return $ret_val = 127; Try this instead: \n"; print_r($ret); echo "\n"; echo "\n"; print_r($err); echo "\n";

Re: [PHP] classes

2008-02-18 Thread Nick Stinemates
Shawn McKenzie wrote: > Jay Blanchard wrote: > >> [snip] >> if i declare an instance of a class in the top of my php file, then >> have html, then later on user $myClassInstance->myMethod(); -- >> myMethod() does not execute, only when i have the instantiation of the >> class right before

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
system("/usr/local/bin/zip -P t.zip biblioteca.php",$ret_val); that's my code and even zip with full path, return $ret_val = 127; On Feb 18, 2008 6:43 PM, Wolf <[EMAIL PROTECTED]> wrote: > > Petrus Bastos <[EMAIL PROTECTED]> wrote: > > Wolf, > > > > I'm sure actually working from t

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Stut
Petrus Bastos wrote: Actually, I don't know anything about FreeBSD. I never used this system. But, here my zip command works fine at command line, why doesn't works with PHP? Is "here" the server or your local machine? If zip works fine on the command line on the server then it's installed

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Wolf
Petrus Bastos <[EMAIL PROTECTED]> wrote: > Wolf, > > I'm sure actually working from the command line. > > > /usr/local/bin/zip -P t.zip biblioteca.php > adding: biblioteca.php (deflated 73%) > > > > > On Feb 18, 2008 6:37 PM, Wolf <[EMAIL PROTECTED]> wrote: > > > > > Pet

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Wolf, I'm sure actually working from the command line. > /usr/local/bin/zip -P t.zip biblioteca.php adding: biblioteca.php (deflated 73%) > On Feb 18, 2008 6:37 PM, Wolf <[EMAIL PROTECTED]> wrote: > > Petrus Bastos <[EMAIL PROTECTED]> wrote: > > Actually, I don't know anyth

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Wolf
Petrus Bastos <[EMAIL PROTECTED]> wrote: > Actually, I don't know anything about FreeBSD. I never used this system. > But, here my zip command works fine at command line, why doesn't works with > PHP? > > Have you talked with your server admins about the use of zip? Sounds like you

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Actually, I don't know anything about FreeBSD. I never used this system. But, here my zip command works fine at command line, why doesn't works with PHP? On Feb 18, 2008 6:28 PM, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > Greg Donald wrote: > > On 2/18/08, Shawn McKenzie <[EMAIL PROTECTED]>

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Shawn McKenzie
Greg Donald wrote: > On 2/18/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote: >> Sure, if you want to miss all the linker and compiler goodies :-) > > I'm guessing that'd be non-issue for an obviously inexperienced FreeBSD user. > > But I'm guessing he'd think it was cool. Also, he's not root so I

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Andrew Ballard
On Feb 18, 2008 4:01 PM, Graham Cossey <[EMAIL PROTECTED]> wrote: > On Feb 18, 2008 6:45 PM, Andrew Ballard <[EMAIL PROTECTED]> wrote: > > On Feb 18, 2008 1:39 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > > > > > On Mon, 2008-02-18 at 13:24 -0500, Andrew Ballard wrote: > > > > On Feb 18,

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Greg Donald
On 2/18/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > Sure, if you want to miss all the linker and compiler goodies :-) I'm guessing that'd be non-issue for an obviously inexperienced FreeBSD user. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsu

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Greg Donald
On 2/18/08, Petrus Bastos <[EMAIL PROTECTED]> wrote: > Error: FTP Unable to get > ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.1-release/Latest/zip.tbz: > File unavailable (e.g., file not found, no access) > pkg_add: unable to fetch > 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packag

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.1-release/Latest/zip.tbz: File unavailable (e.g., file not found, no access) pkg_add: unable to fetch ' ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.1-release/Latest/zip.tbz' by URL :( On Feb 18, 2008 6:17

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Shawn McKenzie
Greg Donald wrote: > On 2/18/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote: >> cd /usr/ports/archivers/zip >> make install clean zip > > pkg_add -r zip > > done. > > Sure, if you want to miss all the linker and compiler goodies :-) -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Greg Donald
On 2/18/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > cd /usr/ports/archivers/zip > make install clean zip pkg_add -r zip done. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Ok. I've tried the command again and returned /usr/local/bin/zip... but return the same error... On Feb 18, 2008 6:13 PM, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > Petrus Bastos wrote: > > Unfortunately, I don't have access to root user here. It was a miracle > get > > access to system command.

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Shawn McKenzie
Petrus Bastos wrote: > Unfortunately, I don't have access to root user here. It was a miracle get > access to system command. I have to resolve this problem without root user. > :( > > On Feb 18, 2008 6:08 PM, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > >> Shawn McKenzie wrote: >>> Petrus Bastos

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Unfortunately, I don't have access to root user here. It was a miracle get access to system command. I have to resolve this problem without root user. :( On Feb 18, 2008 6:08 PM, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > Shawn McKenzie wrote: > > Petrus Bastos wrote: > >> zip program is install

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Daniel Brown
On Feb 18, 2008 4:05 PM, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > Umm, it's been a while for me on BSD, but isn't > '/usr/ports/archivers/zip' a directory holding sources to build zip? Yes, Shawn, you're correct. Ports are (on BSD and MacOS) for automated installations like DEBs and RPMs o

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Shawn McKenzie
Shawn McKenzie wrote: > Petrus Bastos wrote: >> zip program is installed. I'd type whereis and returned >> /usr/ports/archivers/zip. I've change my zip command and put th whole path. >> Now return error 126. :( >> >> On Feb 18, 2008 5:51 PM, Stut <[EMAIL PROTECTED]> wrote: >> >>> Petrus Bastos wrot

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Shawn McKenzie
Petrus Bastos wrote: > zip program is installed. I'd type whereis and returned > /usr/ports/archivers/zip. I've change my zip command and put th whole path. > Now return error 126. :( > > On Feb 18, 2008 5:51 PM, Stut <[EMAIL PROTECTED]> wrote: > >> Petrus Bastos wrote: >>> I'm testing on FreeBSD

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
zip program is installed. I'd type whereis and returned /usr/ports/archivers/zip. I've change my zip command and put th whole path. Now return error 126. :( On Feb 18, 2008 5:51 PM, Stut <[EMAIL PROTECTED]> wrote: > Petrus Bastos wrote: > > I'm testing on FreeBSD. I can use any command through sy

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Graham Cossey
On Feb 18, 2008 6:45 PM, Andrew Ballard <[EMAIL PROTECTED]> wrote: > On Feb 18, 2008 1:39 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > > On Mon, 2008-02-18 at 13:24 -0500, Andrew Ballard wrote: > > > On Feb 18, 2008 1:08 PM, Graham Cossey <[EMAIL PROTECTED]> wrote: > > > > > > > My bigges

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
I'd look at parameters and my command is ok. On Feb 18, 2008 5:51 PM, Nick Stinemates <[EMAIL PROTECTED]> wrote: > Petrus Bastos wrote: > > I'm testing on FreeBSD. I can use any command through system(), but the > zip > > command doesn't works! I don't know why. > > > > > > On Feb 18, 2008 4:06 P

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Yes. On Feb 18, 2008 5:50 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote: > [snip] > I'm testing on FreeBSD. I can use any command through system(), but the > zip > command doesn't works! I don't know why. > [/snip] > > Have you tried the command from the command line without PHP to make > sure it w

Re: [PHP] classes

2008-02-18 Thread Shawn McKenzie
Jay Blanchard wrote: > [snip] > if i declare an instance of a class in the top of my php file, then > have html, then later on user $myClassInstance->myMethod(); -- > myMethod() does not execute, only when i have the instantiation of the > class right before the call to the method does it wor

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Stut
Petrus Bastos wrote: I'm testing on FreeBSD. I can use any command through system(), but the zip command doesn't works! I don't know why. Is zip installed? AFAIK it's not by default. Do a system('whereis zip'); to see. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.ne

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Wolf
Petrus Bastos <[EMAIL PROTECTED]> wrote: > I'm testing on FreeBSD. I can use any command through system(), but the zip > command doesn't works! I don't know why. > > According to Google: http://www.google.com/search?q=php%3A+exec+zip+error+127&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:o

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Nick Stinemates
Petrus Bastos wrote: > I'm testing on FreeBSD. I can use any command through system(), but the zip > command doesn't works! I don't know why. > > > On Feb 18, 2008 4:06 PM, Nick Stinemates <[EMAIL PROTECTED]> wrote: > > >> Petrus Bastos wrote: >> >>> Hey folks, >>> >>>I got access to ex

Re: [PHP] classes

2008-02-18 Thread Stut
nihilism machine wrote: if i declare an instance of a class in the top of my php file, then have html, then later on user $myClassInstance->myMethod(); -- myMethod() does not execute, only when i have the instantiation of the class right before the call to the method does it work. any ideas?

RE: [PHP] Protected ZIP file with password

2008-02-18 Thread Jay Blanchard
[snip] I'm testing on FreeBSD. I can use any command through system(), but the zip command doesn't works! I don't know why. [/snip] Have you tried the command from the command line without PHP to make sure it works? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://w

Re: [PHP] classes

2008-02-18 Thread Nick Stinemates
Jay Blanchard wrote: > [snip] > if i declare an instance of a class in the top of my php file, then > have html, then later on user $myClassInstance->myMethod(); -- > myMethod() does not execute, only when i have the instantiation of the > class right before the call to the method does it wor

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
I'm testing on FreeBSD. I can use any command through system(), but the zip command doesn't works! I don't know why. On Feb 18, 2008 4:06 PM, Nick Stinemates <[EMAIL PROTECTED]> wrote: > Petrus Bastos wrote: > > Hey folks, > > > >I got access to exec method for test! But, it's not working...

[PHP] problem with stream_select and signals

2008-02-18 Thread Marcos Lois Bermúdez
There is any form of detect signal interrupting the stream_select call, some times a signal is not a error and there is other change to get the result, so if *_select tell me if its interruptded by signal. in socket_select i can determine if a signal interrupted the socket_select, but streams

Re: [PHP] separating strings from extensions

2008-02-18 Thread Shawn McKenzie
Børge Holen wrote: > On Monday 18 February 2008 00:10:30 John Meyer wrote: >> Daniel Brown wrote: >>> On Feb 17, 2008 5:37 PM, nihilism machine <[EMAIL PROTECTED]> > wrote: i am using this code to get the extension of a filename: $extension = strtolower(strrchr($fileName,"."));

RE: [PHP] classes

2008-02-18 Thread Jay Blanchard
[snip] if i declare an instance of a class in the top of my php file, then have html, then later on user $myClassInstance->myMethod(); -- myMethod() does not execute, only when i have the instantiation of the class right before the call to the method does it work. any ideas? [/snip] You are

[PHP] classes

2008-02-18 Thread nihilism machine
if i declare an instance of a class in the top of my php file, then have html, then later on user $myClassInstance->myMethod(); -- myMethod() does not execute, only when i have the instantiation of the class right before the call to the method does it work. any ideas? -e -- PHP General Mai

Re: [PHP] separating strings from extensions

2008-02-18 Thread tedd
At 5:56 PM -0500 2/17/08, Daniel Brown wrote: On Feb 17, 2008 5:37 PM, nihilism machine <[EMAIL PROTECTED]> wrote: i am using this code to get the extension of a filename: > $extension = strtolower(strrchr($fileName,".")); how can i get the text BEFORE the . (period) You can STFW an

Re: [PHP] open a secondary window/tab in the browser from php

2008-02-18 Thread tedd
At 1:59 PM +0100 2/18/08, julian wrote: Hi, I have an application that along filling in some forms, it produces a pdf file, as confirmation of all entered data. I want to send this pdf file to a different window/tab of the browser, so it is displayed and can latter be printed. In the mean

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Nick Stinemates
Petrus Bastos wrote: > Hey folks, > >I got access to exec method for test! But, it's not working... :( > the function returns 127 and don't create the zip file, I've tested on > Linux command tool and works! Do you have any idea why didn't work? > > Thanks again and sorry for the inconvenience

[PHP] Re: open a secondary window/tab in the browser from php

2008-02-18 Thread Shawn McKenzie
julian wrote: > > > Hi, > > I have an application that along filling in some forms, it produces a > pdf file, as confirmation of all entered data. > > I want to send this pdf file to a different window/tab of the browser, > so it is displayed and can latter be printed. > > In the mean time, t

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Hey folks, I got access to exec method for test! But, it's not working... :( the function returns 127 and don't create the zip file, I've tested on Linux command tool and works! Do you have any idea why didn't work? Thanks again and sorry for the inconvenience, Petrus Bastos. On Feb 18, 2008

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Andrew Ballard
On Feb 18, 2008 1:39 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Mon, 2008-02-18 at 13:24 -0500, Andrew Ballard wrote: > > On Feb 18, 2008 1:08 PM, Graham Cossey <[EMAIL PROTECTED]> wrote: > > > > > My biggest gripe with tab delimited files is > > > that they are quite a bit bigger than

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Robert Cummings
On Mon, 2008-02-18 at 13:24 -0500, Andrew Ballard wrote: > On Feb 18, 2008 1:08 PM, Graham Cossey <[EMAIL PROTECTED]> wrote: > > > My biggest gripe with tab delimited files is > > that they are quite a bit bigger than comma delimited files so I may > > have to split the large files I receive into

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Andrew Ballard
On Feb 18, 2008 1:08 PM, Graham Cossey <[EMAIL PROTECTED]> wrote: > My biggest gripe with tab delimited files is > that they are quite a bit bigger than comma delimited files so I may > have to split the large files I receive into smaller 'chunks' to allow > them to be uploaded. > > Why would tab-

Re: [PHP] separating strings from extensions

2008-02-18 Thread Richard Lynch
Since you provide the suffice (extension) to basename, it's not basename that's broken... It's not knowing what extension you wanted to provide in the first place... On Mon, February 18, 2008 11:56 am, Nick Stinemates wrote: > Richard Lynch wrote: >> On Sun, February 17, 2008 4:37 pm, nihilism ma

Re: [PHP] question about database field-types and special characters

2008-02-18 Thread Richard Lynch
On Thu, February 14, 2008 8:47 pm, Rob Gould wrote: > Should I have used utf-8 instead? Yes. And you need to convince not only the MySQL server to use UTF-8, but also the MySQL client compiled into your PHP to use UTF-8. -- Some people have a "gift" link here. Know what I want? I want you to bu

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Graham Cossey
On Feb 18, 2008 5:23 PM, Andrew Ballard <[EMAIL PROTECTED]> wrote: > > On Feb 18, 2008 12:02 PM, Edward Kay <[EMAIL PROTECTED]> wrote: > > > > > > On Mon, February 18, 2008 10:36 am, Jay Blanchard wrote: > > > > [snip] > > > > That's funny... MS defaults to tabs for a file whose extension is .csv >

Re: [PHP] XSLTProcessor without validation

2008-02-18 Thread Richard Lynch
On Fri, February 15, 2008 12:54 am, Siegfried Gipp wrote: > Am Donnerstag, 14. Februar 2008 21:01:42 schrieb Richard Lynch: > >> You could also consider filing a "Feature Request" in >> http://bugs.php.net/ > Well, the bug reporting page has a bug. A graphical captcha is needed, > but > there is

Re: [PHP] Fwrite Function

2008-02-18 Thread Richard Lynch
On Sat, February 16, 2008 6:03 am, Yuval Schwartz wrote: > Hello, > > Can you please help me, I am writing code where I create a file and > write to > it from a form on a webpage and then read and display this file on the > webpage. > I want to change the color of the text that is written to the

Re: [PHP] Sending XML to MSIE7

2008-02-18 Thread Richard Lynch
On Fri, February 15, 2008 10:03 am, Shawn McKenzie wrote: > Brian Dunning wrote: >>> Isn't it enough to send it with Content-Type: >>> application/octet-stream ? > > Do you want the user to download the file? Try using: > 'Content-Disposition: attachment; filename="..."' Apologies in advance to o

Re: [PHP] separating strings from extensions

2008-02-18 Thread Nick Stinemates
Richard Lynch wrote: > On Sun, February 17, 2008 4:37 pm, nihilism machine wrote: > >> i am using this code to get the extension of a filename: >> >> $extension = strtolower(strrchr($fileName,".")); >> >> how can i get the text BEFORE the . (period) >> > > http://php.net/basename > > Fun

Re: [PHP] Sending XML to MSIE7

2008-02-18 Thread Richard Lynch
If IE does anything other than a file download with application/octet-stream, it's very broken indeed... Does your URL end in .xml? Often IE "assumes" the Content-type is not correct, and runs with the idea that the end of the URL in 8.3 notation is what the file REALLY is. On Fri, February 15,

Re: [PHP] Check time in between times

2008-02-18 Thread Nick Stinemates
Richard Lynch wrote: > On Sat, February 16, 2008 11:53 pm, Johny Burns wrote: > >> I am having fields in my table where I put times like 4:30pm in string >> format >> > > This is your first mistake... > > Use time fields for time, so you can do time operations on time fields. > > Otherwise,

Re: [PHP] Gzipped output

2008-02-18 Thread Richard Lynch
On Fri, February 15, 2008 8:54 am, Eric Butera wrote: > On Thu, Feb 14, 2008 at 3:52 PM, Richard Lynch <[EMAIL PROTECTED]> wrote: >> >> >> On Mon, February 11, 2008 9:59 am, Eric Butera wrote: >> > On Feb 11, 2008 10:44 AM, Per Jessen <[EMAIL PROTECTED]> wrote: >> >> Eric Butera wrote: >> >> >>

Re: [PHP] Semaphores without sysvmsg?

2008-02-18 Thread Richard Lynch
On Fri, February 15, 2008 6:42 pm, Michael McGlothlin wrote: > Does anyone have a good method of supporting semaphores when PHP's > System V IPC functions can't be enabled? I'm trying to implement > locking > for using shmop (actually modifying someone elses code) and it > requires > sysvmsg but my

Re: [PHP] www. not working

2008-02-18 Thread Richard Lynch
On Fri, February 15, 2008 2:46 pm, nihilism machine wrote: > this still does not work, if a domain has no preceeding www. it > redirects to http://www.www.site.com, if it has a www. it goes to > www.www.mydomain.com > , any ideas? Don't do that. Some sites may or may not use www. for whatever rea

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Nick Stinemates
Petrus Bastos wrote: > Richard, > > Unfortunately, I can't get out of the zip password rut because the > destination system read only this file format. I can't change the > destination system. > > Thanks, > Petrus. > > On Feb 18, 2008 2:11 PM, Richard Lynch <[EMAIL PROTECTED]> wrote: > > >>

Re: [PHP] Session destruction problem

2008-02-18 Thread Richard Lynch
On Sat, February 16, 2008 2:31 pm, Adil Drissi wrote: > I need help with sessions. > I have a simple authentification relying only on > sessions (i don't use cookies). Do you mean that you are also using the "no_cookie" setting in PHP and using the URL to pass around the session ID? Or jut that y

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Nick Stinemates
Richard Lynch wrote: > On Sun, February 17, 2008 1:57 pm, Nick Stinemates wrote: > >> Petrus Bastos wrote: >> >>> Hi Nick, >>> >>> Sorry, but I forgot to tell you that I can't use this exec >>> neither >>> system commands because they are disabled for security precautions. >>> So, Do >>

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Casey
On Feb 18, 2008 9:07 AM, Richard Lynch <[EMAIL PROTECTED]> wrote: > On Sun, February 17, 2008 1:57 pm, Nick Stinemates wrote: > > Petrus Bastos wrote: > >> Hi Nick, > >> > >> Sorry, but I forgot to tell you that I can't use this exec > >> neither > >> system commands because they are disabled f

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Andrew Ballard
On Feb 18, 2008 12:02 PM, Edward Kay <[EMAIL PROTECTED]> wrote: > > > On Mon, February 18, 2008 10:36 am, Jay Blanchard wrote: > > > [snip] > > > That's funny... MS defaults to tabs for a file whose extension is .csv > > > which is an acronym for (C)omma (S)eparated (V)alues. > > > [/snip] > > > >

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Richard, Unfortunately, I can't get out of the zip password rut because the destination system read only this file format. I can't change the destination system. Thanks, Petrus. On Feb 18, 2008 2:11 PM, Richard Lynch <[EMAIL PROTECTED]> wrote: > On Mon, February 18, 2008 5:59 am, Petrus Ba

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Richard Lynch
On Mon, February 18, 2008 5:59 am, Petrus Bastos wrote: > Thanks again for your worry. So, let's go, here goes my situation. > I'm > exporting data to another system. That system have an option to be > feed by a > password protected zip file. The export activity will be occur in this > way: > t

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Richard Lynch
On Sun, February 17, 2008 1:57 pm, Nick Stinemates wrote: > Petrus Bastos wrote: >> Hi Nick, >> >> Sorry, but I forgot to tell you that I can't use this exec >> neither >> system commands because they are disabled for security precautions. >> So, Do >> you have any other ideas on how can I do t

RE: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Edward Kay
> On Mon, February 18, 2008 10:36 am, Jay Blanchard wrote: > > [snip] > > That's funny... MS defaults to tabs for a file whose extension is .csv > > which is an acronym for (C)omma (S)eparated (V)alues. > > [/snip] > > > > Welcome to Microsoftwhere do we want you to go today? > > I think it de

Re: [PHP] PHP/mySQL dropping zeros after inserting number into record

2008-02-18 Thread Richard Lynch
On Sat, February 16, 2008 5:22 pm, Rob Gould wrote: > I've got a PHP script that inserts "00012345678" into a record in a > mySQL database (it's a barcode). Things work ok unless the number has > preceding zeros, and then the zeros get cut off and all I get is > "12345678". > > I have the mySQL da

Re: [PHP] Check time in between times

2008-02-18 Thread Richard Lynch
On Sat, February 16, 2008 11:53 pm, Johny Burns wrote: > I am having fields in my table where I put times like 4:30pm in string > format This is your first mistake... Use time fields for time, so you can do time operations on time fields. Otherwise, you are just re-inventing the wheel and re-wri

Re: [PHP] regex usage

2008-02-18 Thread Richard Lynch
On Sun, February 17, 2008 9:34 am, Valedol wrote: > Is there a mothod to check string`s length with regex or the only way > is > using strlen? > > I want string consisting of 4 digits > and check string with this code: > > if (preg_match("/\d{4}/",$_POST[id])) > { echo $_POST[id]; } > > but preg_

Re: [PHP] Protected ZIP file with password

2008-02-18 Thread Petrus Bastos
Daniel, But I can install PEAR/PECL modules, but I didn't see any module that do what I want. Do you know any module that create password protected zip files? Thanks again, Petrus Bastos. On Feb 18, 2008 1:29 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Feb 18, 2008 11:18 AM, Petrus Bas

Re: [PHP] separating strings from extensions

2008-02-18 Thread Richard Lynch
On Sun, February 17, 2008 4:37 pm, nihilism machine wrote: > i am using this code to get the extension of a filename: > > $extension = strtolower(strrchr($fileName,".")); > > how can i get the text BEFORE the . (period) http://php.net/basename -- Some people have a "gift" link here. Know what I

  1   2   >