Hi,
I have a question. I am working on a php4/mysql furniture catalogue site which has italian and french products,
and therefore I have special characters such "é", "è", "ù", and so on... in the products names.
I use a the javascript function "variable_in_link(variable-value)" and window.open to open a photo viewer for each product.
It works well, but with a product name like "Noé", the variable passed loses the accent (é).
I tried php's urlencode, but it looks like javascript "parses"(sorry:-) ) the link, not php (?)
so my name variable "Noé" arrives in the pop-up as "N" (kind of strange, I also lose the "o" :-)
Any ideas ? Thanks in advance !
Here's the code (hope it appears).
$clid > collection id (the collection the product belongs to)
$clnm > collection's name ("Noé" arrives as "N" in the pop-up window)
$bdnm > brand name (the brand the collection belongs to)
The Javascript :
</title>
<script LANGUAGE="JavaScript">
<!--
function variable_in_link(varible_value)
// function variable_in_link will assign the first variable
// passed to it as variable_value
{
new_win = window.open('http://127.0.0.1/~christia/decologia/viewer.php?'+varible_value+'','', 'location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=640,height=400,left=10,top=10')
}
//-->
</script>
...and the PHP
while ( $photoqueryrow = mysql_fetch_array($hpphotoquery))
{
$hpphoto = $photoqueryrow["PhotoURL"];
?>
<a HREF="javascript:variable_in_link('
<?php
echo ("clid=" . $clid . "&clnm=");
echo (urlencode($clnm));
echo ("&bdnm=");
echo (urlencode($bdnm));
?>
')">
<?php
echo ("
<img SRC='" . $hpphoto . "' "
);
}
?>