<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1042060" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1042060</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Yeah thanks for the</title>
    <link>https://www.webmaster-forums.net/webmasters-corner/double-quotes-vanish-html-forms#comment-1234153</link>
    <description> &lt;p&gt;Yeah thanks for the correction. It was a quickly typed question.&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Oct 2008 17:09:51 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1234153 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Quote:
Shouldn&#039;t</title>
    <link>https://www.webmaster-forums.net/webmasters-corner/double-quotes-vanish-html-forms#comment-1234150</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;Quote:&lt;/div&gt;Shouldn&#039;t mysql_escape put a slash in front of each &quot;, so it would be stored in the db as :&lt;br /&gt;
hello /&quot;world/&quot;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;just a minor correction/comment:&lt;/p&gt;
&lt;p&gt;the example incorrectly uses forward slashes to escape, instead of backslashes. It should be:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;quot;hello \&amp;quot;world\&amp;quot;&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;While pr0gr4mm3r has explained how to deal with quotes and special characters in PHP, you need to pay close attention to escaped characters working with form input using JavaScript.&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Oct 2008 14:36:34 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1234150 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>pr0gr4mm3r wrote:
Nope, the</title>
    <link>https://www.webmaster-forums.net/webmasters-corner/double-quotes-vanish-html-forms#comment-1234149</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;pr0gr4mm3r&lt;/em&gt; wrote:&lt;/div&gt;Nope, the backslash is in the query and it tells MySQL to treat the quotes as a part of a string, and not a string terminator.&lt;/div&gt;&lt;br /&gt;
yeees. and I had this discussion a while back in this forum...I remember now.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;pr0gr4mm3r&lt;/em&gt; wrote:&lt;/div&gt;&lt;br /&gt;
Your HTML probably looked something like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;some_input&amp;quot; value=&amp;quot;hello &amp;quot;world&amp;quot;&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Your browser takes the first quote before &#039;world&#039; as the end quote of the string.&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;It&#039;s in php, so this is what it actually is&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; name=&quot;songname[&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$song_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;]&quot; maxlength=&quot;70&quot; size=&quot;70&quot; value=&quot;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$song_name&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&quot;&amp;gt;&amp;lt;/td&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;So you are correct (again &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/tongue.png&quot; title=&quot;Sticking out tongue&quot; alt=&quot;Sticking out tongue&quot; class=&quot;smiley-content&quot; /&gt; ) &lt;/p&gt;
&lt;p&gt;Something so simple.. I was ready to go find the the server and strip out its hard drive, and it was basic html knowledge.&lt;/p&gt;
&lt;p&gt;Cheers programmer &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/beer.png&quot; title=&quot;Cheers!&quot; alt=&quot;Cheers!&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Oct 2008 14:08:00 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1234149 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>It is stored in the db</title>
    <link>https://www.webmaster-forums.net/webmasters-corner/double-quotes-vanish-html-forms#comment-1234148</link>
    <description> &lt;blockquote&gt;&lt;p&gt;It is stored in the db exactly as that. Shouldn&#039;t mysql_escape put a slash in front of each &quot;, so it would be stored in the db as...&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Nope, the backslash is in the query (you can verify by temporarily echoing it to the browser), and it tells MySQL to treat the quotes as a part of a string, and not a string terminator.  There is no need to store that in the database.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;No quotes and the word in the quotes also gone (the space is still present after the first word).&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Using &lt;a href=&quot;http://us2.php.net/manual/en/function.htmlspecialchars.php&quot;&gt;htmlspecialchars()&lt;/a&gt; when you are displaying output from the database will solve that problem.  Your HTML probably looked something like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;some_input&amp;quot; value=&amp;quot;hello &amp;quot;world&amp;quot;&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Your browser takes the first quote before &#039;world&#039; as the end quote of the string.  By using &lt;a href=&quot;http://us2.php.net/manual/en/function.htmlspecialchars.php&quot;&gt;htmlspecialchars()&lt;/a&gt;, it will look like this, and display correctly:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;some_input&amp;quot; value=&amp;quot;hello &amp;amp;quot;world&amp;amp;quot;&amp;quot;&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Oct 2008 13:07:00 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1234148 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
