Re: using variables from a form in a longish script - outside of functions
| From: | Gary Singleton | Date: | Sat, 23 Sep 2000 16:38:42 +0000 |
| Subject: | Re: using variables from a form in a longish script - outside of functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17495@lists.php.net to get a copy of this message | ||
Hi Helmut, I'm new to PHP but I've been dealing with a similar issue so maybe I can help.
Just to clarify, do you mean that you can echo the values at tbe beginning of the script but not
further on in the same script? If so I'm not sure what's causing that unless you use
unset but what I've done in order to keep variable values across several pages is use PHP
sessions and register my variables as session variables. This works pretty well for me and is
simpler than setting cookies on the first page and destroying them at the end which is what
I've done in the past. I was going to try to explain it but there are better explanations than
I could give at the links below.
HTH, G.S.
http://www.php.net/manual/ref.session.php
http://www.developersshed.com/Server_Side/PHP/Sessions/
http://www.phpbuilder.com/columns/
http://hotwired.lycos.com/webmonkey/00/05/index2a_page6.html?tw=programming
*********** REPLY SEPARATOR ***********
On 9/21/00 at 8:07 PM ott89@t-online.de wrote:
>in a longish script I have variables coming in from a form like this:
>
>A user fills in username & password and action calls the script - the variable values are
>passed to the script - so far this works.
>
>Now when e.g. I want the user to add a new record (which is the purpose of the script) the
>variables (that echoed their passed over values in the beginning of the script) are empty when used
>further down. Though there is no function involved (where I could define the variables as global ),
>only a if-statement within which the variables are used.
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com