PHP注册成功脚本无效

时间:2013-12-08 05:11:09

标签: php mysql scripting scripting-language

注册后,没有“已成功注册”消息,也没有重定向到index.php。需要帮助。

<?php
include("connect.php");

if (isset($_POST['save']))
{
  addcustomer($_POST['firstname'],$_POST['middlename'],$_POST['lastname'],
              $_POST['email'],$_POST['username'],$_POST['password'],
              $_POST['age'],$_POST['gender'],$_POST['barangay'],
              $_POST['com_address']);
  $success = "<script language='javascript' >
              alert('Register Succesfully')
              window.location='index.php'
              </script>";
}
?>

1 个答案:

答案 0 :(得分:3)

您需要输出 $success 变量

echo $success; 之前的print $success;}