";:<script><html>< // >@@#";

Reply

Join Date: Jun 2007
Posts: 57
Reputation: naju is an unknown quantity at this point 
Solved Threads: 2
naju's Avatar
naju naju is offline Offline
Junior Poster in Training

";:<script><html>< // >@@#";

 
0
  #1
Jan 28th, 2009
if some users insert data like
";:<script><html>< // >@@#";

then i Sanitize this data to something like
&quot;;:&lt;script&gt;&lt;html&gt;&lt; // &gt;@@
before inserting to db
when i print this form db to html

for inside <p> tag its cool but for inside h1 tag is prints as it is
<h1>&quot;;:&lt;script&gt;&lt;html&gt;&lt; // &gt;@@</h1>
output: &quot;;:&lt;script&gt;&lt;html&gt;&lt; // &gt;@@

<p>&quot;;:&lt;script&gt;&lt;html&gt;&lt; // &gt;@@</p>
output: ";:<script><html>< // >@@#";

now i need to corrent on h1 tag to make similar to <p> tag

thanks
Hunters Never Hurt
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 938
Reputation: ardav will become famous soon enough ardav will become famous soon enough 
Solved Threads: 123
ardav's Avatar
ardav ardav is online now Online
Posting Shark

Re: ";:<script><html>< // >@@#";

 
0
  #2
Jan 28th, 2009
You need to html_entity_decode() the string before outputting to html. If you checkout your database entry (through phpmyadmin or whatever it's called or a good GUI), you'll probably see that the &quot; .... has changed to &amp;quot; ....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC