ElectricShaka Posted February 10, 2008 Share Posted February 10, 2008 I am trying to take a string in text area and POST it so that I can put it into another text area on a different page and then later add it to a MySQL database. This is the code above my text area to start the form: <form action='AddNewTheme.php' method='POST'>\n"; ?> <center><textarea name="themeCode" cols=50 rows=10 class="bginput" onClick="this.focus();this.select()"> My problem is that the text in the text area is pretty complicated, usually something like: <style type="text/css"> body {background-color:; background-image:url(); background-position:Top Left; background-attachment:fixed; background-repeat:no-repeat;} Table, Td { background-color:transparent; border-style:none; } table table td { width:100%; } table table table table td { width:auto; } table table table { background-color:; background-image:url(); background-position:Top Center; background-repeat:no-repeat; border-color:; border-style:solid; border-width:; padding:4px; filter:alpha(opacity=99.9999999999999999); -moz-opacity:0.99.9999999999999999; opacity:0.99.9999999999999999; -khtml-opacity:0.99.9999999999999999; } table table table table{ background-image:none; background-color:transparent; border-style:none; } .orangetext15, .lightbluetext8, .whitetext12, .nametext, .btext, .redtext, .redbtext {color:; font-size:10pt; font-style:normal; font-family:,arial,verdana,sans-serif;} body, div, p, strong, td, .text, .blacktext10, .blacktext12, a.searchlinkSmall, a.searchlinkSmall:link, a.searchlinkSmall:visited { color:; font-size:10pt; font-style:normal; font-family:,arial,verdana,sans-serif;} a, a:link, a:visited, a.navbar, a.navbar:link, a.navbar:visited, a.man, a.man:link, a.man:visited {color:; font-size:10pt; font-style:normal; font-family:,arial,verdana,sans-serif;} a:hover, a:active, a.navbar:hover, a.navbar:active, a.man:hover, a.man:active, a.searchlinkSmall:hover, a.searchlinkSmall:active {color:; font-size:10pt; font-style:normal; font-family:,arial,verdana,sans-serif;} </style><br> <br>This profile was edited with <a href="http://www.epiklayouts.com" target="_blank">Epik Layouts</a><br><br> </div><a href="http://www.epiklayouts.com" target=_blank>Myspace Layouts</a><br> <div style="position:absolute;left:0px;top:0px;width:88px;height:31px;"><a href="http://www.epiklayouts.com">EpikLayouts.com</a></div> The above shows up correctly in my first text area. But then when I put the string into a new text area on the next page like this: echo "Theme Code: <textarea onClick='this.focus();this.select()' rows='20' cols='70' name='themeCode'>$_POST[themeCode]</textarea> \n"; it ends up putting a \ before every " looking like this: <style type=\"text/css\"> body {background-color:; background-image:url(); background-position:Top Left; background-attachment:fixed; background-repeat:no-repeat;} Table, Td { background-color:transparent; border-style:none; } table table td { width:100%; } table table table table td { width:auto; } table table table { background-color:; background-image:url(); background-position:Top Center; background-repeat:no-repeat; border-color:; border-style:solid; border-width:; padding:4px; filter:alpha(opacity=99.9999999999999999); -moz-opacity:0.99.9999999999999999; opacity:0.99.9999999999999999; -khtml-opacity:0.99.9999999999999999; } table table table table{ background-image:none; background-color:transparent; border-style:none; } .orangetext15, .lightbluetext8, .whitetext12, .nametext, .btext, .redtext, .redbtext {color:; font-size:10pt; font-style:normal; font-family:,arial,verdana,sans-serif;} body, div, p, strong, td, .text, .blacktext10, .blacktext12, a.searchlinkSmall, a.searchlinkSmall:link, a.searchlinkSmall:visited { color:; font-size:10pt; font-style:normal; font-family:,arial,verdana,sans-serif;} a, a:link, a:visited, a.navbar, a.navbar:link, a.navbar:visited, a.man, a.man:link, a.man:visited {color:; font-size:10pt; font-style:normal; font-family:,arial,verdana,sans-serif;} a:hover, a:active, a.navbar:hover, a.navbar:active, a.man:hover, a.man:active, a.searchlinkSmall:hover, a.searchlinkSmall:active {color:; font-size:10pt; font-style:normal; font-family:,arial,verdana,sans-serif;} </style><br> <br>This profile was edited with <a href=\"http://www.epiklayouts.com\" target=\"_blank\">Epik Layouts</a><br><br> </div><a href=\"http://www.epiklayouts.com\" target=_blank>Myspace Layouts</a><br> <div style=\"position:absolute;left:0px;top:0px;width:88px;height:31px;\"><a href=\"http://www.epiklayouts.com\">EpikLayouts.com</a></div> If anyone could help me with this I'd greatly appreciate it. Quote Link to comment https://forums.phpfreaks.com/topic/90303-passing-a-textarea-string-to-the-post-superglobal-array/ Share on other sites More sharing options...
kenrbnsn Posted February 10, 2008 Share Posted February 10, 2008 Using the function stripslashes() will remove the backslashes from the string. The function nl2br() will make the string display correctly again in the next textarea. Ken Quote Link to comment https://forums.phpfreaks.com/topic/90303-passing-a-textarea-string-to-the-post-superglobal-array/#findComment-463026 Share on other sites More sharing options...
ElectricShaka Posted February 10, 2008 Author Share Posted February 10, 2008 The stripslashes() worked well for me thank you very much for your time and speed! You guys here at php freaks are really awesome about helping new people out. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/90303-passing-a-textarea-string-to-the-post-superglobal-array/#findComment-463035 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.