Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

How To Protect Special Characters in Query String?

3 like 0 dislike
Hello guys,

How To Protect Special Characters in Query String?

Please give me your feedback
asked 1 year ago by daneim (127,080 points)
<a href="http://www.discountu99boots.com/ugg-classic-cardy-c-1">ugg classic cardy</a>
<a href="http://www.discountu99boots.com/ugg-crochet-c-15">ugg crochet</a>
<a href="http://www.discountu99boots.com/ugg-romantic-flower/romantic-flower-blush-ugg-boots-classic-tall-p-15.html">ugg romantic flower</a>Thank you post. It isn’t easy advice explained so well I was doing, and trying to find
1 year ago by anonymous

1 Answer

1 like 0 dislike
 
Best answer
f you want to include special characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The script below shows how to use urlencode():

Quote:
<?php
print("<html>");
print("<p>Please click the links below"
." to submit comments about FYICenter.com:</p>");
$comment = 'I want to say: "It\'s a good site! :->"';
$comment = urlencode($comment);
print("<p>"
."<a href=\"processing_forms.php?name=Guest&comment=$co mment\">"
."It's an excellent site!</a></p>");
$comment = 'This visitor said: "It\'s an average site! :-("';
$comment = urlencode($comment);
print("<p>"
.'<a href="processing_forms.php?'.$comment.'">'
."It's an average site.</a></p>");
print("</html>");
?>
answered 1 year ago by marck_don (191,010 points)

Related questions

6 like 0 dislike
0 answers
5 like 0 dislike
0 answers
6 like 0 dislike
1 answer
3 like 0 dislike
1 answer
4 like 0 dislike
1 answer