Re: static variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Suresh,
You could use the link to pass your variable to the next page, or to the same page:
Instead of
   $count=0;
use
   if (!isset($_GET['count'])) $count=0;
Then for your link use
print "<a href=http://www.whatever.com?count=$count>link to new page</a>"
or use
print "<a href=".$_SERVER['PHP_SELF']."?count=$count>link to same page</a>"
if you want to return to the same page with an updated count.
HTH
HTD
----- Original Message ----- From: "suresh kumar" <asureshkumar_1983@xxxxxxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Sent: Thursday, February 09, 2006 9:50 PM
Subject:  static variables


hai everbody

           i am facing a problem with static
variable. i declared $count=0 as Static variable,when
i click the link specified in anchor tag my page is
refreshed again and static variable lose its value and
assigned with 0.i want the logic code say  my stsic
variable will not lose scope when i click next,i am
looking forward reply from u.
                                  A.suresh



__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.4/255 - Release Date: 2/9/2006





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.4/255 - Release Date: 2/9/2006

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux