php_guest Posted September 16, 2009 Share Posted September 16, 2009 Please help with about the following questions. I would like to save data from WYSIWYG into mysql and create preview before that. Question 1: If I understand right the trim function makes that php ignore character ",' etc. and they are still shown in html. The htmlspecialchars change those characters with others to not confuse php. I am right? Question 2: I tried both of functions and I have still a problem. echo "<form action='nov.php' method='post'><input type='hidden' name='content' value='".$content."'><input type='submit' name='submit' value='Back to edit'></form>"; shows '>submit button instead only Back to edit submit button. Did I miss anything? Thank you Link to comment https://forums.phpfreaks.com/topic/174521-from-wysiwyg-edito-into-mysql-htmlspecialchars-or-trim/ Share on other sites More sharing options...
khr2003 Posted September 17, 2009 Share Posted September 17, 2009 see these links for the explanation of the functions: http://www.w3schools.com/PHP/func_string_htmlspecialchars.asp http://www.w3schools.com/PHP/func_string_trim.asp as of the second question I do not understand how it related to trim() or htmlspecialchars() functions since you use these functions before inserting data into mysql while the line you posted is to display the form straightaway from the php code. anyway try this code and see if its working: echo "<form action='nov.php' method='post'><input type='hidden' name='content' value='$content'><input type='submit' name='submit' value='Back to edit'></form>"; Link to comment https://forums.phpfreaks.com/topic/174521-from-wysiwyg-edito-into-mysql-htmlspecialchars-or-trim/#findComment-919917 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.