Jump to content

from WYSIWYG edito into mysql. htmlspecialchars or trim?


php_guest

Recommended Posts

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

 

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>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.