Re: Passing Parameters

From: Date: Fri, 07 Jul 2000 09:23:40 +0000
Subject: Re: Passing Parameters
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-5349@lists.php.net to get a copy of this message
On Fri, 07 Jul 2000, Steffen Kamper wrote: > I'm newbie. So I want to pass variables to a php-file like: > page3.php3?session=1&user=555. > Can I pass it like this and how can I get the vars in page3.php3 ? > Thanx. If you pass it via the url line (GET method) you can referance it like this $HTTP_GET_VARS["session"] and $HTTP_GET_VARS["user"] Get the idea? $HTTP_GET_VARS["variable_name"] If you pass it via the POST method (with a form or some such thing) you can do it with: $HTTP_POST_VARS["variable_name"]; Now, thats a clean way of doing it. A slightly dirtyer way to doing it, that could end up with some variable scope problems is just to referance them directly ie: page3.php?session=1&user=555 session and user are stored in $session and $user respectivly. hope you understood that..its late and I shouldn't answer questions when its late..heh :) -- - James Atkinson 'Today is an illusion, it is but an echo of yesterday and a shadow on tommorow' http://www.totalgeek.org

« previous php.general (#5349) next »