我正在尝试使用php和bootstrap提交电子邮件订阅时事通讯.var_dump($ _ POST)输出:array(1){'subscribe_submit'=> string(0)""}
这是我的HTML:
subscribe.php
query($sql); $row=$result->fetch_assoc(); if($result->num_rows == 1) { echo "You are already subscribed to our minutes."; }else { $sql = "INSERT INTO minutes (email) VALUES ($email)"; if ($db->query($sql)) { echo "New record created successfully"; } else { echo "Error: " . $sql . "
" . mysqli_error($db); } $db->close(); } } ?>
我一整天都在绞尽脑汁想弄清楚它为什么不起作用.提前致谢.
你忘记了最重要的属性 name="email"