php3-list | 199908
Date: 08/30/99
- Next message: Richard Lynch: "Re: [PHP3] [php3 + mysql] uninitialized property(submit) in form"
- Previous message: Rômul: "[PHP3] php3 script checker"
- Next in thread: Mark Musone: "Re: [PHP3] Global function doesn't keep its value"
- Reply: Mark Musone: "Re: [PHP3] Global function doesn't keep its value"
- Maybe reply: christopher wright: "Re: [PHP3] Global function doesn't keep its value"
- Reply: Richard Lynch: "Re: [PHP3] Global function doesn't keep its value"
- Maybe reply: raschn <email protected>: "RE: [PHP3] Global function doesn't keep its value"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I wrote this simple script and couldn't get it to work as expected. The
script name is globaltest.php3. I expected everytime I executed this
script, it will increment $myglobal by one. Therefore, I should see
"myglobal is now 1", the next time I click "here", I should get
"myglobal is now 2", and so on, and so on. But instead, I kept getting
"myglobal is now 1" all the time. Any idea on what's wrong with the
script? BTW, I already limit my apache httpd child process to maximum of
2. Therefore, if the request hits different process everytime, I
expected it to at least increment $myglobal after the third click to
"here".
<HTML>
<BODY>
<H1> myglobal is now
<?PHP
$myglobal = 0;
function incrementglobal()
{
global $myglobal;
$myglobal = $myglobal + 1;
}
incrementglobal();
print ($myglobal);
?>
</H1> <br>
Click <A HREF=globaltest.php3> here</A> to increment myglobal again
</BODY>
</HTML>
Any help will be appreciated.
Thanks,
Eddy Ng
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Richard Lynch: "Re: [PHP3] [php3 + mysql] uninitialized property(submit) in form"
- Previous message: Rômul: "[PHP3] php3 script checker"
- Next in thread: Mark Musone: "Re: [PHP3] Global function doesn't keep its value"
- Reply: Mark Musone: "Re: [PHP3] Global function doesn't keep its value"
- Maybe reply: christopher wright: "Re: [PHP3] Global function doesn't keep its value"
- Reply: Richard Lynch: "Re: [PHP3] Global function doesn't keep its value"
- Maybe reply: raschn <email protected>: "RE: [PHP3] Global function doesn't keep its value"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

