Parameter variables strange behaviour

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
EricGen
Forum Newbie
Posts: 11
Joined: Tue Jul 15, 2003 4:18 am

Parameter variables strange behaviour

Post by EricGen »

Hi,

I have a strange problem with parameter variables. In one page I have a link:
echo '<a href="vigneron.php?terroir=' . urlencode($row["name"]);
echo '&vigneron=' . $row["vigneron_id"] . '" class ="wp">' . $row["vigneron_name"] . '</a>, ';

In vigneron.php, I do
$terroir = urldecode($terroir);

It works fine for most values, yet for a variable called St Chinian, the variable $terroir is
Saint Chinian&vigneron=21
which is obviously wrong. Does anybody know what the problem is?

Thanks
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Post by Tubbietoeter »

try

$terroir = urldecode($_GET['terroir']);

and

echo "<pre>"; print_r($_GET); echo "</pre>";

to debug
EricGen
Forum Newbie
Posts: 11
Joined: Tue Jul 15, 2003 4:18 am

Post by EricGen »

Great,

$terroir = urldecode($_GET['terroir']);

did the trick, thanks very much
Post Reply