p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

beginning_php thread: Re: htmlspecialchars-THANKS SO MUCH!

Message #1 by "Avegael Guarin" <go_emile@a...> on Wed, 09 Oct 2002 10:50:47 -0500
Hello John,
Thanks for the help. I haven't tested it yet cause it's too late in the night and it's quite a tiring day.
Anyway, just seeing your codes, I believe you've helped me trully. God Bless and more great endeavors ahead...
----- Original Message -----
From: "Periklis Paschidis" <perikpas@o...>
Date: Wed, 9 Oct 2002 14:00:53
To: "beginning php" <beginning_php@p...>
Subject: [beginning_php] Re: htmlspecialchars

its simple. You use it after you take the variables.



<form action="file2.php" method="get">
<input type="text" name="UserName">
<input type="submit">



$UserName = HTMLSpecialChars($UserName);
echo "Your name is: $UserName";

So.. if the user has input html code with is name...
example: <b>John</b>

the <b></b> tags will be removed and the name will be seen o screen in 
normal text.

simple is'n it? :-)

I hope i help you.


Sign-up for your own FREE Personalized E-mail at Mail.com


"Free price comparison tool gives you the best prices and cash back!"


  Return to Index