search

Home  >  Q&A  >  body text

Why can't I find the id and alert statements when I submit a message using notepid++?

<?php

include ("conn.php");

$id=$_POST['id'];

$user=$_POST['user'];

$title=$_POST['title'];

$content=$_POST['content'];

if($_POST['submit']){

$sql="insert into message(id,user,title,content,lastdate)VALUES('','$user','$title','$content',now())";

mysql_query($sql);

echo "<seript>alert('提交成功');location.href='add.html';</seript>";

}

?>


微蕤轻凉微蕤轻凉2348 days ago1195

reply all(3)I'll reply

  • 浮云

    浮云2018-08-07 22:53:11

    I'm not curious about anything else, I'm just curious about where your $id came from. Is there an id in the submitted $_POST array? It seems that I didn’t see

    when I output it.

    reply
    0
  • 亚连

    亚连2018-06-11 09:25:27

    It's not<seript>, it's<script>

    reply
    0
  • 亚连

    亚连2018-06-11 09:24:28

    echo "<seript>alert('Submission successful');location.href='add.html';</seript>"; Take a closer look at this statement to find any errors?

    reply
    0
  • Cancelreply