try it and see
if it doesn't work, try using base64_encode() and base64_decode()
after all, you're not encrypting the string, just making sure the script
handles it okay, ay?

-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 3:21 PM
To: php
Subject: [PHP] carrying a query string

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?


current script: page.php?var1=foo&var2=bah

$script = $_SERVER['PHP_SELF'];
$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.


Justin French

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to