Re: register globals on
| From: | J R | Date: | Tue, 12 Sep 2006 07:41:40 +0000 |
| Subject: | Re: register globals on | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241648@lists.php.net to get a copy of this message | ||
correction: $GLOBALS not $_GLOBAL
:)
cheers
On 9/12/06, J R <blue.jr@gmail.com> wrote:
there are many ways you can keep information. now if you must really use global. you can still use global even if the server is set to global off by using $_GLOBAL or using globals decleration. example: $test = 'i'm global'; function f1() { echo $_GLOBAL['test']; // should display i'm global } function f2() { global $test; echo $test; // should display i'm global } now for your forms. i'm not sure is the above will work (to lazy to verify :)) use the other predefined variables like $_POST, $_GET, $_REQUEST thats where data from your forms are stored when the page is submited. and if you want to keep your data when your user move from one page to the other, store it in a session "$_SESSION". remeber to always start session "session_start()" on every page. read more: http://php.net/reserved.variables my advice, avoid using globals. It leads to lots of error that are hard to debug and reproduce. hth, john On 9/12/06, Zbigniew Szalbot <admin@szalbot.homedns.org> wrote: Hello again, On Tue, 12 Sep 2006, Chris wrote:-- GMail Rocks!!!itI thought I would ask your opinion before we make any decision. Isis notreally so that without register globals, such things as displaying information from databases based on the initial choice of languagesThanks a lot! Any hint what to use instead? I mean I will tell him to re-think things but with techi guys I would simply feel better saying we need to rework the website using...??? Thank you again! -- Zbigniew Szalbot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- GMail Rocks!!!an option? I am not a programmer so I just need general guidance.Complete rubbish. He's being lazy.