Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,153 questions

40,707 answers

573 users

How to convert characters to HTML entities to prevent code injecting attack in PHP

2 Answers

0 votes
$s = htmlspecialchars("<a href='test.php'>Test</a>");
print $s; 

/*
run:

&lt;a href='test.php'&gt;Test&lt;/a&gt;
 
*/

 





answered Nov 21, 2015 by avibootz
0 votes
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">

 





answered Nov 21, 2015 by avibootz

Related questions

1 answer 75 views
3 answers 115 views
2 answers 87 views
2 answers 113 views
1 answer 68 views
...