carrying a query string
| From: | Justin French | Date: | Thu, 06 Jun 2002 05:20:33 +0000 |
| Subject: | carrying a query string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-100885@lists.php.net to get a copy of this message | ||
hi all,
will urlencode($QUERY_STRING) be sufficient enough conversion of the query
string to enable me to pass the query string around as a var in the url?
eg
current script: page.php?var1=foo&var2=bah
<?
$script = $_SERVER['PHP_SELF'];
$qs = $_SERVER['QUERY_STRING'];
$ref = urlencode($script.$qs);
<A HREF="email_a_friend.php?ref=$ref">email this page to a friend</a>
?>
Then on email_a_friend.php I can urldecode() the $ref, so that I now the
file and query string of the referring page.
I guess I'm worried that urlencode may not sufficiently obscure the old
query string, which may cause confusion on the second script.
Any suggestions? This is basically a way of me ensuring I have a referring
url, since HTTP_REFERER isn't always set my the browser.
Thanks,
Justin French