Why can't I write code?

Source: Internet
Author: User
Why can't I write code? & Nbsp; & lt; a & nbsp; hrefstudent_voice.php? Doadd & gt; add exam & lt; a & gt; php code: if ($ _ GET [do] add) {& nbsp; include & nbsp; DedeIncl why can't I write code?
Add exam

Php code:
if($_GET['do']=='add'){
include DedeInclude('templets/student/student_voice_add.htm');
$id = $_POST['username'];
$email = $_POST['email'];
$content = $_POST['content'];
$time = date('Y-m-d H:i:s');
$category = $_POST['category'];
$flag = $_POST['flags'];
$flags=implode(",",$flag);
$checked = $_POST['checked'];
//echo $id."
".$email."
".$content."
".$time."
".$category."
".$flags."
".$checked;
$sql = "INSERT INTO djs_skstudent_voice (username ,content ,time ,category ,checked ,email ,flag)VALUES ('$id','$content', '$time' , '$category', '$checked','$email','$flags')";
$dsql->ExecuteNoneQuery($sql);

But can be added. However, it will add a blank value for all values. Then you want to add it. That is to say, he will first execute all SQL statements with null values. What's going on?

Share: More


------ Solution --------------------
Before running the command, output the SQL statement.

$ SQL = "INSERT INTO djs_skstudent_voice (username, content, time, category, checked, email, flag) VALUES ('$ ID',' $ content', '$ time ', '$ category', '$ checked',' $ email ',' $ flags ')";

Die ($ SQL );
------ Solution --------------------
Click the link in get mode.
$ _ POST array cannot have a value

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.