Forum Moderators: coopster
$text="The boy said, "My dog's name is Spot."";
// I need addslashes somewhere but not sure where.
// Also will I need stripslashes before displaying on the page?
$query="UPDATE table2 SET pagetext='$text' WHERE uid='5'";
mysql_query($query);
echo "Record Updated";
mysql_close();
UPDATE (assuming it's posted and the textarea name is newcontent)
$text = mysql_real_escape_string($_POST['newcontent']);
$query="UPDATE table2 SET pagetext='$text' WHERE uid='5'";
mysql_query($query);
echo "Record Updated";
mysql_close();
I would imagine you would have to load uid along with the text on the form and post it as a hidden field or something. You may want to look at nl2br maybe but I don't know if you will need that or not. If you are the only person using this then other measures in regards to security shouldn't be needed.
Looking at the varname 'pagetext' I wonder if you might just want to look into a premade CMS solution that will already allow all this.