Re: Passing query parameter which has value "###"

From: Date: Mon, 08 Sep 2003 11:45:37 +0000
Subject: Re: Passing query parameter which has value "###"
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-161978@lists.php.net to get a copy of this message
At 13:04 8-9-03, you wrote:
I passed value main.php?name=$name&id=$id&id1=$id1 to next page where $id has value "###" In the next page I was not able to get the $id and $id1 values and I am able to get the two values $id1 and $name when I used main.php?name=$name&id1=$id1 What might be the problem?
The # in a url is used for the in-page anchors, e.g. if you have an anchor in your page <a name="chapter2"></a>, then a url such as page.html#chapter2 will jump to that location in the page. So the part after the # is cut off by the browser, i suppose. Try this: <?php echo '<a href="main.php?name='.$name.'&id='. urlencode($id).'">'; ?> This changes the # to a code (% followed by some number) (check urlencode in the manual)

« previous php.general (#161978) next »