Use the $ _ POST variable

Source: Internet
Author: User
I wrote a small program with the $ _ POST variable but encountered a problem when the $ _ POST variable was used. First: $ _ POST [& quot; submit & quot;] does not seem to work. if you click it, the system does not respond. Second: $ _ POST [& quot; user & quot;], $ _ POST [& quot; title & quot;], $ _ POST [& quot; content & quot;] an error is reported. you must increase the problem of using the $ _ POST variable.
I wrote a small program, but there was a problem when I used the $ _ POST variable.
First, $ _ POST ["submit"] does not seem to work. after clicking it, the system does not respond.
Second: $ _ POST ["user"], $ _ POST ["title"], $ _ POST ["content"] will report an error. you must increase the brackets, I don't understand why, for example, {$ _ POST ["user"]}, {$ _ POST ["title"]}, {$ _ POST ["content.
Which of the following can help you take a look.

Include ("conn. php ");

If ($ _ POST ["submit"])
{
$ SQL = "INSERT INTO message (id, user, title, content, lastdate )".
"Values ('', {$ _ POST ["user"] },{$ _ POST ["title"] },{$ _ POST ["content"]}, now ())";
Echo "Success ";
$ Result = @ mysql_query ($ SQL, $ conn) or die (mysql_error ());
}


?>




------ Solution --------------------
HTML code
     

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.