An error occurred while making the PHP + MYSQL message board code.

Source: Internet
Author: User
Why? Include (& quot; conn. php & quot;); if ($ _ POST [& #039; sumbit & #039;]) (echo $ SQL & quot; insertintomessage (id, user, title, content, lastdate) & quot ;. & quot; values (& #039; & #039;, & #039; $ _ POST [user] & #039;, & #039; $ _ POST [title] & #039;, & #039; $ _ POST [content] & #0 Why?

Include ("conn. php ");

If ($ _ POST ['sumbit ']) (

Echo $ SQL = "insert into message (id, user, title, content, lastdate )".
"Values ('', '$ _ POST [user]', '$ _ POST [title]', '$ _ POST [content]', now ())";
)

User:
Title:
Content:

In the case of a browser
(! ) Parse error: syntax error, unexpected 'echo '(T_ECHO) in C: \ demo \ test01 \ de \ add. php on line 6

Reply content:

Why?

Include ("conn. php ");

If ($ _ POST ['sumbit ']) (

Echo $ SQL = "insert into message (id, user, title, content, lastdate )".
"Values ('', '$ _ POST [user]', '$ _ POST [title]', '$ _ POST [content]', now ())";
)

User:
Title:
Content:

In the case of a browser
(! ) Parse error: syntax error, unexpected 'echo '(T_ECHO) in C: \ demo \ test01 \ de \ add. php on line 6

Well, isn't the if code segment enclosed by braces? Why are you using parentheses?

include("conn.php");if($_POST['sumbit'])($sql="insert into message (id,user,title,content,lastdate) " ."values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";echo $sql;)

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.