Forum Moderators: coopster

Message Too Old, No Replies

<?php echo $_SERVER['PHP_SELF'];?> Question...

Can you carry variables into it?

         

ahmedtheking

12:56 pm on Jan 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The statement:

<?php echo $_SERVER['PHP_SELF'];?>

would echo something like 'index.php' depending what your file is called, BUT is there a way to get it to echo the file and the VARs:

index.php?get=this&get=that

Is that poss?

dmorison

1:09 pm on Jan 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use $_SERVER['QUERY_STRING'] instead - although i'm not sure if that contains the script name. If it doesn't, just use it in combination with PHP_SELF if necessary:

$_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']

coopster

11:38 pm on Jan 2, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



or grab REQUEST_URI instead...