Page 1 of 1

Parameter variables strange behaviour

Posted: Tue Jul 15, 2003 4:18 am
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

Posted: Tue Jul 15, 2003 7:50 am
by Tubbietoeter
try

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

and

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

to debug

Posted: Tue Jul 15, 2003 10:49 am
by EricGen
Great,

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

did the trick, thanks very much