This code has always been abnormal. Please help me look at it. I have studied it all morning. Thanks

Source: Internet
Author: User
This code has always been wrong. Take a look at it for me. I have studied it for one afternoon. Thank you & nbsp; & lt; ahref = 'index. php' & gt; return message board & lt;/a & gt; & lt; hr & gt; & lt ;? Php/* & nbsp; * this code is always incorrect. Take a look at it for me. I have studied it for one afternoon. Thank you.


Back to message board


/*

* To change the template for this generated file go

* Window-Preferences-PHPeclipse-PHP-Code Templates

*/

Require ("conn. php ");

$ User = $ _ POST ['user'];

$ Title = $ _ POST ['title'];

$ Content = $ _ POST ['content'];

$ SQL _luck = "insert into sny (id, user, title, content, lastDate) value ('', '$ user',' $ title', '$ content ', now ())";

$ SQL = "SELECT user FROM sny WHERE user = '$ user '";

$ Query = mysql_query ($ SQL );

$ Rows = mysql_fetch_array ($ query );

If ((! Empty ($ _ POST ['sub']) and ($ rows ['user'] = $ user )){

// Echo $ content;

Echo "script" alert ('User already exists, enter 'again); location. href = 'add2. php' script "; exit;



Mysql_free_result ($ query); exit;

}

Else {

Mysql_query ($ SQL _luck );

Echo "script" alert ('Yo! Successful! '); Location. href = 'index. php' script ";

Echo "successful insertion ";

}









?>



User:


Title:






Content: <Br/> text











------ Solution --------------------
Can I use and in php or use the & symbol .?
------ Solution --------------------
Take a closer look at your judgment. Okay?

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.