Re: passing GET via include

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux