我寫了一個註冊在PHP頁面,一切正常和值都被保存在數據庫中,但之後的值保存到數據庫中的不開放下一頁 這裏是我的碼。請檢查可能是什麼問題。獲取值到數據庫中,但歡迎頁面無法打開
<?php
if (isset($_POST['button']))
{
$st_name=$_POST['st_name'];
$f_name=$_POST['f_name'];
$email=$_POST['email'];
$re_email=$_POST['re_email'];
$pass=$_POST['pass'];
$re_pass=$_POST['re_pass'];
$phone=$_POST['phone'];
$mobile=$_POST['mobile'];
$skype=$_POST['skype'];
$quali=$_POST['quali'];
$country=$_POST['country'];
$city=$_POST['city'];
$date=$_POST['date'];
$g=$_POST['g'];
$image="back.jpg";
if($email!=$re_email){
echo "<script>window.open('sign_up.php?error=email_error','_self')</script>";
}
else if($pass!=$re_pass){
echo "<script>window.open('sign_up.php?error=pass_error','_self')</script>";
}
else{
$que="insert into sign_up(st_name,f_name,email,re_email,pass,re_pass,phone,mobile,skype,quali,country,city,date,gender,image)
values ('$st_name','$f_name','$email','$re_email','$pass','$re_pass','$phone','$mobile','$skype','$quali','$country','$city','$date','$g','$image')";
if(mysql_query($que))
{
$_SESSION['email']=$email;
$_SESSION['pass']=$pass;
header("location: index.php");
}
else{
mysql_error();
}
}
}
?>
如果加上'在session_start()會發生什麼;在'
Jamesking56
我寫了session_start();在頂部 –