Re: passing GET via include

From: Date: Fri, 04 May 2007 21:59:42 +0000
Subject: Re: passing GET via include
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-254447@lists.php.net to get a copy of this message
On Fri, May 4, 2007 2:22 am, Mark Smith wrote: > Is there a way to allow the passing of variables to included scripts > using the GET method, for example include"file.php?name=person"; or is > there another method of including files that allow you to do this. I > have attempted to do this without success, I just get a message saying > the file cannot be found. Well, there's sort of a way to do that. Don't do anything. :-) The variable is already there, waiting for you to use it. You may want to study up on "scope" however: http://us.php.net/manual/en/language.variables.scope.php If you are in a function, you need to pass $name to that function, or you need to declare it "global" Passing it in is almost always better. If you just want the original $_GET data, raw and unfiltered, $_GET is a "superglobal" and you can juse it anywhere, any time. (Ditto for $_POST and all the others) -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#254447) next »