How to do Php Security check for input user fields and input user treatment(please if you can solve example1+2)?
Example1: check if user insert url or something else:
<label>url: </label>
<input type="text">
Example2: check if user insert html or something else
<label>paste html: </label>
<textarea></textarea>
thanks
1. For the validation of URLs :
When the link is return to the user, use htmlentities().
2. For the validation of HTML code, use a lib like http://htmlpurifier.org/.
With the input :
The result is :