<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1022679" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1022679</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1140175</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;Busy wrote:&lt;/strong&gt; I like the html character one&lt;br /&gt;
$stuff = htmlspecialchars($stuff);&lt;br /&gt;
the other one is addslashes() / stripslashes()&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;actually the slashes are for slashing out things such as &quot; and &#039;that may need it for a db.&lt;/p&gt;
&lt;p&gt;the &lt;a href=&quot;http://us3.php.net/manual/en/function.htmlspecialchars.php&quot; class=&quot;bb-url&quot;&gt;htmlspecialchars&lt;/a&gt; and &lt;a href=&quot;http://us3.php.net/manual/en/function.htmlentities.php&quot; class=&quot;bb-url&quot;&gt;HTMLENTITIES&lt;/a&gt; are for removing html so that people cannot put in scripts or such upon your pages viia posting.&lt;/p&gt;
 </description>
     <pubDate>Thu, 06 Nov 2003 22:33:14 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1140175 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1139963</link>
    <description> &lt;p&gt;you should really have the &#039;type&#039; of input it is as well (type=&quot;text&quot;), also quotes around all values&lt;/p&gt;
 </description>
     <pubDate>Sun, 02 Nov 2003 08:55:31 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1139963 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1139960</link>
    <description> &lt;p&gt;Heh -- when in doubt, view source. &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; I&#039;ve done it too often to mention myself.&lt;/p&gt;
 </description>
     <pubDate>Sun, 02 Nov 2003 01:34:10 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1139960 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1139958</link>
    <description> &lt;p&gt;argh! got it... sorry about the hassle...&lt;/p&gt;
&lt;p&gt;I had an edit page. where I would reload the previously entered content into all the fields&lt;/p&gt;
&lt;p&gt;like so:&lt;/p&gt;
&lt;p&gt;&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;if I previously entered say &amp;quot; in the field and saved it&lt;br /&gt;
then go back to the edit page - the fields will be reloaded with the code above&lt;br /&gt;
if you looked at the output html it would read&lt;/p&gt;
&lt;p&gt;but on the screen it would read &quot; inside the edit field, not &amp;quot; - that is where it went wrong!!!! after clicking save again on that form, it would change it to a &quot; in the database&lt;/p&gt;
&lt;p&gt;all I had to do is start with blank fields:&lt;/p&gt;
&lt;p&gt;then call a php generated javascript function to fill the form - that worked...&lt;/p&gt;
&lt;p&gt;function fillForm() {&lt;br /&gt;
  &amp;lt;? echo &quot;document.formname.caption.value=&#039;$caption&#039;;\n&quot;; ?&amp;gt;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;just means I now have to first parse the $caption string in php, and replace any &#039; with \&#039; so it does not stuff up the javascript but that is not too bad&lt;/p&gt;
&lt;p&gt;once again, sorry about the hassle - should have seen that ages ago&lt;/p&gt;
 </description>
     <pubDate>Sun, 02 Nov 2003 00:56:28 +0000</pubDate>
 <dc:creator>robvdl</dc:creator>
 <guid isPermaLink="false">comment 1139958 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1139954</link>
    <description> &lt;p&gt;yes it is being converted here is how I am sure:&lt;/p&gt;
&lt;p&gt;document1.php:&lt;/p&gt;
&lt;p&gt;The user puts this in the field: &amp;quot; clicks submit/save&lt;/p&gt;
&lt;p&gt;document2.php:&lt;/p&gt;
&lt;p&gt;the variable $caption now contains &quot; not &amp;quot; like I need it to&lt;/p&gt;
 </description>
     <pubDate>Sat, 01 Nov 2003 23:10:18 +0000</pubDate>
 <dc:creator>robvdl</dc:creator>
 <guid isPermaLink="false">comment 1139954 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1139953</link>
    <description> &lt;p&gt;Are you sure that the data is being converted? Or is it being displayed weirdly instead? It shouldn&#039;t be converted unless you tell it to be converted.&lt;/p&gt;
&lt;p&gt;Per usual, an url or sample code would help people set you on the right path. Your solution, while it works, means a LOT of extra work for no good reason?&lt;/p&gt;
 </description>
     <pubDate>Sat, 01 Nov 2003 23:02:18 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1139953 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1139952</link>
    <description> &lt;p&gt;Hmmm, well, I tried some answers, no luck - but I found my own way that works.&lt;/p&gt;
&lt;p&gt;problem is, the textarea seemed to be converted automatically when the submit button was pressed, and I seemed to have no control over it&lt;/p&gt;
&lt;p&gt;yes, it is true, you should be able to reconvert back to html, after the form had been sent, with some special function. But I think if there were some odd cases, the field could not be converted back exactly the way the field was before submit was pressed, by such a function. if you get what I mean. - maybe not..&lt;/p&gt;
&lt;p&gt;I just find it odd, the form is converted automatically when submit is pressed in the first place - I mean, what is the point of that?&lt;/p&gt;
&lt;p&gt;anyway, I got so desperate and I thought of an alternative way out.&lt;/p&gt;
&lt;p&gt;I created two forms, one with actual fields + a submit button, this is the temp form. but the submit button goes to a javascript function instead&lt;/p&gt;
&lt;p&gt;the second form, is full of hidden fields. when the submit button is pressed on the temp form, the javascript converts all text fields to hex strings eg &quot;B023AF&quot; in groups of two it copies them to the hidden fields on the second form, and uses javascript to post the second form instead&lt;/p&gt;
&lt;p&gt;crude, but it works. I just decode the strings back at the other end in php, and the fields are perfect.&lt;/p&gt;
 </description>
     <pubDate>Sat, 01 Nov 2003 22:55:20 +0000</pubDate>
 <dc:creator>robvdl</dc:creator>
 <guid isPermaLink="false">comment 1139952 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1139930</link>
    <description> &lt;p&gt;I like the html character one&lt;br /&gt;
$stuff = htmlspecialchars($stuff);&lt;br /&gt;
the other one is addslashes() / stripslashes()&lt;/p&gt;
 </description>
     <pubDate>Sat, 01 Nov 2003 09:20:34 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1139930 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/form-data-converted-send#comment-1139921</link>
    <description> &lt;p&gt;$stringvariablename = str_replace (&quot;&amp;amp;&quot;,&quot;&amp;amp;&quot;,$stringvariablename);&lt;/p&gt;
&lt;p&gt;Alternatively there are a number of html functions that preserve and/or strip html from the input and replace it in the db as something else.&lt;/p&gt;
&lt;p&gt;Then you can do another function on the data on the way out of the db to HTMLize it. &lt;/p&gt;
&lt;p&gt;In general you want to convert the fields to prevent mean nasty hackers from entering bad news into your forms and causing mischief...&lt;/p&gt;
 </description>
     <pubDate>Sat, 01 Nov 2003 02:56:40 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1139921 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
