Saturday, October 30, 2010

How To Protect Special Characters in Query String?

If 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():


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 >

.”
.”It’s an excellent site!
< /p >
”);
$comment = ‘This visitor said: “It\’s an average site! :-(“‘;
$comment = urlencode($comment);
print(“< p >

.’
.”It’s an average site.

”);
print(“< /html >”);

No comments:

Post a Comment

I just got my #domain @BigRock. Get upto 25% off with my personalized coupon link Get upto 25% off