小编mon*_*908的帖子

Javascript警报窗口重定向到另一个网页

    <?php

session_start();

include_once "connect.php";

$fullName = $_POST['fullname'];
$userName = $_POST['username'];
$emailAdd = $_POST['email'];
$passWord = $_POST['password'];
$query =  mysql_query("SELECT * FROM users where USERNAME = '$username' ");
$result = mysql_fetch_array($query);

  if($fullName == "")
  {

?>
    <script>
      alert("Full Name is required!");
      window.location.href = "registeruser.php";
    </script>
<?php
  }

    else
    {
      if ($userName == "")
      {
?>
        <script>
          alert("Invalid username!");
          window.location.href = "registeruser.php";
        </script>
 <?php     
      }

        else
        {
          if($userName == $result['USERNAME'])
          {
?>
            <script>
              alert("Username already exists!");
              window.location.href = "registeruser.php";
            </script>
<?php
          } …
Run Code Online (Sandbox Code Playgroud)

javascript php alert

13
推荐指数
1
解决办法
1847
查看次数

标签 统计

alert ×1

javascript ×1

php ×1