passing params thru url that include "<

liunx

Guest
Ok, I'd like to pass the title of my page to it from another page. It was pretty simple. I made it <!-- m --><a class="postlink" href="http://www.mysite.com/page.php?title=MyTitle">http://www.mysite.com/page.php?title=MyTitle</a><!-- m -->. I can do spaces using %20, BUT if I try to pass quotes (") It appears in the title as \"

<!-- m --><a class="postlink" href="http://campbells.dikaios.net/babyx.php">http://campbells.dikaios.net/babyx.php</a><!-- m -->
click on the first picture.

Can this be fixed?

Aaron

EDIT: I was setting up the second picture on that same page, and I had another little snag. If I pass a ' it also comes out as a \' Click on the second picture, and mouse over the picture to view the title of the image.I'll attach the picture.php file...on your page where you are grabbing the title, the new window, you need to add this

$title = stripslashes($_GET["title"]);

that will make it so it takes aay the slash before the quote.

as far as the last question, I am not understanding? it works doesn't it?Sorry...that should have read: If I pass a ' it also comes out as a \'

Anyway, the same thing solved both...thanks

AaronFor future reference, it's good to use urlencode() in combination with htmlentities(), to create your own 'safe' query string.

$title = htmlentities(urlencode($title));

<a href=http://www.htmlforums.com/archive/index.php/"/picture.php?title=$title">Link</a>

Further reading here,
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/function.urlencode.php">http://www.php.net/manual/en/function.urlencode.php</a><!-- m -->
 
Back
Top