我有一个复选框,可以使后密码protected-注意:未定义指数
<p><strong><label for="password">Password protect?</label></strong> <input type="checkbox" name="password" id="password" value="1" /></p>
我的PHP试图进行后
$password = htmlspecialchars(strip_tags($_POST['password']));
我得到未定义指数错误。
现在,如果我尝试先检查是否设置密码,我得到executing-
$sql = "INSERT INTO blog (timestamp,title,entry,password) VALUES ('$timestamp','$title','$entry','$password')";
$result = mysql_query($sql) or print("Can't insert into table blog.<br />" . $sql . "<br />" . mysql_error());
如何解决它同样的错误?我是否必须为标题文本框等所有字段执行此操作?
我觉得老同学去反对有条件的经营者'if'声明路线。 :( – 2010-01-31 18:50:24