我不断收到此通知:未定义的变量:此行代码第7行/var/www/html/ies.aacrao.org/apply/copies.php中的上一页:
if ($previouspage == "copies.php") {
// _s2 variables are the shipping address for the included copy
$first_s2 = $_SESSION['first_s2'] = $_POST['first_s2'];
$last_s2 = $_SESSION['last_s2'] = $_POST['last_s2'];
$email_s2 = $_SESSION['email_s2'] = $_POST['email_s2'];
$phone_s2 = $_SESSION['phone_s2'] = $_POST['phone_s2'];
$title_s2 = $_SESSION['title_s2'] = $_POST['title_s2'];
$office_s2 = $_SESSION['office_s2'] = $_POST['office_s2'];
$institution_s2 = $_SESSION['institution_s2'] = $_POST['institution_s2'];
}
任何人都可以给我一些关于如何解决这个问题的建议。所有这些变量都应该插入到数据库表中,并且目前它们没有被插入。
答案 0 :(得分:0)
if(!empty($previouspage) && $previouspage == "copies.php")
或
if(isset($previouspage) && $previouspage == "copies.php")
我会选择!empty()
。
顺便说一句,看看这些功能。
Isset:http://tr2.php.net/isset
快速解释:
清空检查变量是否已定义且具有值, isset只检查变量是否已定义。