<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1032828" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1032828</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/webmasters-corner/strip-unknown-characters-textarea#comment-1192256</link>
    <description> &lt;p&gt;Actually, the code is changing the curly quotes to regular quotes.  It works properly, just not while submitting a form for some reason.&lt;/p&gt;
&lt;p&gt;I had to add a similar script which identified and replaced those weird symbols mysql replaced the curly quotes with (i.e. â€™) onto the output page instead of on the input page.&lt;/p&gt;
&lt;p&gt;It seems to be working just as well.&lt;/p&gt;
 </description>
     <pubDate>Wed, 01 Feb 2006 03:45:33 +0000</pubDate>
 <dc:creator>airoid3000</dc:creator>
 <guid isPermaLink="false">comment 1192256 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/webmasters-corner/strip-unknown-characters-textarea#comment-1192193</link>
    <description> &lt;p&gt;The smiley face is ; ) by the way&lt;/p&gt;
 </description>
     <pubDate>Tue, 31 Jan 2006 16:07:58 +0000</pubDate>
 <dc:creator>Dux0r</dc:creator>
 <guid isPermaLink="false">comment 1192193 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/webmasters-corner/strip-unknown-characters-textarea#comment-1192192</link>
    <description> &lt;p&gt;It seems to me like you&#039;ve got your search and replace backwards. From what you&#039;ve got above the codes (ie &amp;rsquo;) will be replaced with quotes (ie &#039;).&lt;/p&gt;
&lt;p&gt;If you&#039;re trying to put them in the database, surely you want to remove the quotes? Or convert them to the symbols.&lt;/p&gt;
&lt;p&gt;If not then sorry for my mistake.&lt;/p&gt;
&lt;p&gt;You might also want to try using strip_slashes() and add_slashes() which will make any string safe for use in a MySQL statement.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
 </description>
     <pubDate>Tue, 31 Jan 2006 16:07:05 +0000</pubDate>
 <dc:creator>Dux0r</dc:creator>
 <guid isPermaLink="false">comment 1192192 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/webmasters-corner/strip-unknown-characters-textarea#comment-1192030</link>
    <description> &lt;p&gt;Here is what I have so far:&lt;/p&gt;
&lt;p&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;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;convert_smart_quotes&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$string&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) &lt;br /&gt;{ &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$search &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;amp;lsquo;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;amp;rsquo;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;amp;ldquo;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;amp;rdquo;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;amp;mdash;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$replace &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&#039;\&quot;, &lt;br /&gt;\&quot;&#039;\&quot;, &lt;br /&gt;&#039;\&quot;&#039;, &lt;br /&gt;&#039;\&quot;&#039;, &lt;br /&gt;&#039;-&#039;); &lt;br /&gt;&lt;br /&gt;return str_replace(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$search&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$replace&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$string&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); &lt;br /&gt;} &lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
This works perfectly when I have static text on the page like so:&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;$thistext &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;amp;lsquo;single quotes&amp;amp;rsquo;\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$text&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = convert_smart_quotes(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$thistext&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;echo \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$text&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
However, I am trying submit the value from a text field and then run the function before I enter it into the database like so:&lt;/p&gt;
&lt;p&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;$convertedtextarea&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;convert_smart_quotes&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$textarea&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;For some reason it enters into the database just as it was typed in the textarea without ever replacing the quotation marks.  Any suggestions?  HELP!&lt;/p&gt;
 </description>
     <pubDate>Mon, 30 Jan 2006 03:22:07 +0000</pubDate>
 <dc:creator>airoid3000</dc:creator>
 <guid isPermaLink="false">comment 1192030 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/webmasters-corner/strip-unknown-characters-textarea#comment-1192019</link>
    <description> &lt;p&gt;I am using php and mysql on linux.  Could you point to to a location of one of those modules?&lt;/p&gt;
&lt;p&gt;By the way, here are the most common problems:&lt;/p&gt;
&lt;p&gt;“  needs to be  &quot;&lt;br /&gt;
’  needs to be  &#039;&lt;/p&gt;
 </description>
     <pubDate>Mon, 30 Jan 2006 00:37:02 +0000</pubDate>
 <dc:creator>airoid3000</dc:creator>
 <guid isPermaLink="false">comment 1192019 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/webmasters-corner/strip-unknown-characters-textarea#comment-1192013</link>
    <description> &lt;p&gt;depending on your os, code, and whatnot, there are modules to do this&lt;br /&gt;
to prevent from injecting bad stuff into mysql before inserting.&lt;/p&gt;
&lt;p&gt;there is also regular expressions and whatnot you can use&lt;br /&gt;
If you are using Php, go to php.net and search for function preg_match&lt;br /&gt;
preg_replace etc&lt;/p&gt;
 </description>
     <pubDate>Mon, 30 Jan 2006 00:09:27 +0000</pubDate>
 <dc:creator>bugmaster</dc:creator>
 <guid isPermaLink="false">comment 1192013 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
