Jack101
12-31-2002, 11:38 AM
Hi All,
Thanks in advance for any help you can give with this.
I have the following which links from frame A to frames B and C when an item in the frame A list is selected.
while ($row= mysql_fetch_array($result))
{$id=$row['id'];
$name=$row['name'];
$otherdata=$row['otherdata'];
echo("<tr><td><a href=\"javascript:
void(parent.FrameB.location='FrameB.php?id=$id&name=$name&otherdata$otherdata');
void(parent.FrameC.location='FrameC.php?=$id');
\"> ".$name."</a></td></tr>");}
My problem is that if the value of $name has a single quote the link doesn't work. I assume this is because it is confusing the javascript.
If I apply addslashes on the variable:
$name=addslashes($name);
I just get a value of, for example, O[backslash]'Keefe (for O'Keefe). The quote is still there and still seems to confuse the javascript, and it displays with the '[backslash]' in the frame A list.
I have magic quotes on.
(I am writing '[backslash]' rather than the real thing as this editor seems to ignore the real thing?? - it has also put a space between 'java' and 'script' above - I didn't key it that way???)
Thanks, Jack.
Thanks in advance for any help you can give with this.
I have the following which links from frame A to frames B and C when an item in the frame A list is selected.
while ($row= mysql_fetch_array($result))
{$id=$row['id'];
$name=$row['name'];
$otherdata=$row['otherdata'];
echo("<tr><td><a href=\"javascript:
void(parent.FrameB.location='FrameB.php?id=$id&name=$name&otherdata$otherdata');
void(parent.FrameC.location='FrameC.php?=$id');
\"> ".$name."</a></td></tr>");}
My problem is that if the value of $name has a single quote the link doesn't work. I assume this is because it is confusing the javascript.
If I apply addslashes on the variable:
$name=addslashes($name);
I just get a value of, for example, O[backslash]'Keefe (for O'Keefe). The quote is still there and still seems to confuse the javascript, and it displays with the '[backslash]' in the frame A list.
I have magic quotes on.
(I am writing '[backslash]' rather than the real thing as this editor seems to ignore the real thing?? - it has also put a space between 'java' and 'script' above - I didn't key it that way???)
Thanks, Jack.