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] 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 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 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] 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: 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

[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] 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] 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

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 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 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
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: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 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 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

[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] 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. -- .--

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: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

<    1   2