Error using forms

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Chinclub
Forum Newbie
Posts: 13
Joined: Sun Aug 31, 2008 7:33 am

Error using forms

Post by Chinclub »

I have a script that allows a person to fill out a basic form then it inserts the info into the database. However if the person uses quotation marks in their text it throws an error.
I know there is a way to fix it, however I can't remember what that is.
Here is the insert script. Can you remind me what I am missing that will allow quotation marks ?

Code: Select all


$Title = $_POST['Title'];
$text = $_POST['text'];

$insert = mysql_query("INSERT INTO `story` (`id_`,`Title`, `username`, `date`, `text`) VALUES('0', \"$Title\",  '{$_COOKIE['chinclub']}', '$date', \"$text\")");

User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: Error using forms

Post by twinedev »

Post Reply