我需要帮助我如何在页面中使用变量并在另一页中使用此变量。
就像在register.php中一样
$query=mysql_query( " INSERT INTO user (firstname,lastname,username,email,password,country)
VALUES ('$firstname','$lastname','$username','$email','$password','$country') ") or die(mysql_error() );
}
$a=1;
if(isset($query) && $captcha == $kemet )
header("Location: check_register.php");
和check_register.php
if($a=1){ echo "hello";}
为此我想在check_register中使用变量$a
当所有条件都在寄存器中完成并转到check_register
我试过
$query=mysql_query( " INSERT INTO user
(firstname,lastname,username,
email,password,country)
VALUES ('$firstname','$lastname','$username',
'$email','$password','$country') ")
or die(mysql_error() );
}
$a=1;
if(isset($query) && $captcha == $kemet )
$_SESSION['login_user'] = $username;
header("Location: login_done.php");
和check_register
if($_SESSION['login_user'] = $username;) {
echo "hello ";
}
答案 0 :(得分:0)
为此你需要使用查询字符串..
像这样:header("Location: check_register.php?result=1");
在check_register.php中,您需要使用$a = $_GET['result']
或
$a = $_REQUEST['result']