[thelist] help me understand global variable in PHP

Tom Dell'Aringa pixelmech at yahoo.com
Thu Jan 2 12:56:01 CST 2003


--- shawn allen <shawn at alterior.net> wrote:
> quoth Tom Dell'Aringa:
> > Now, my problem is - I want to pass along $prodname to the next
> page
> > I am going to via the query string. So I have something like
> > /path.php?p=$prodname. This variable however is always empty.
> This
> > line of code is OUTSIDE the functions of course.
>
> Without knowing how your host is configured, I'm willing to bet
> that
> PHP's 'register_globals' directive is set to 'off'. This is a Good
> Thing(tm). To retrieve a request variable, you have to pull the
> value
> from the $_REQUEST array:
>
> $prodname = $_REQUEST['prodname'];
> $prodname = $_GET['prodname'];

Yes, I am actually doing this in my target page...the second line
$_GET as you specified. My problem isn't getting it there (I am able
to get 2 other variables in that querystring). I need to get my
variable that is set INSIDE the function available to me OUTSIDE of
it.

Tom

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the thelist mailing list