Forum Moderators: coopster

Message Too Old, No Replies

Getting url parameters from an included page

Getting url parameters from an included page

         

spykadesign

11:23 pm on Feb 10, 2006 (gmt 0)

10+ Year Member



im not sure if its possible but..

how would i get the url variables from an page included, maybe this will explain it better.

if i put this in my foo.php page:

<?
include("page.php?item=bar");
?>

could i get the value of "item" in page.php by using:
$citem = $_GET['item'];

or whatever or is there something else i need to do?

jatar_k

11:37 pm on Feb 10, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you can't include a page like that but you could set the variable and have it available to the included code

maybe this will explain it better

<?
$citem = 'bar';
include("page.php");
?>

spykadesign

1:07 am on Feb 11, 2006 (gmt 0)

10+ Year Member



Oh yes i get it thanks for the help!