表格在else语句中提交确认

时间:2014-12-07 14:41:10

标签: javascript php jquery

美好的一天。我的问题是,javascript警报不会对else语句起作用。在我的其他声明中,我想显示一个javacript警告,注册成功,但它没有出现..这里是我的代码

<?php 

 if(isset($_POST['potpot'])){
$file=$_FILES['image']['tmp_name'];
$image= addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name= addslashes($_FILES['image'] ['name']);
$image_size= getimagesize($_FILES['image'] ['tmp_name']);
if ($image_size==FALSE) { ?>
    <script type='text/javascript'>alert('Oppss! Thats not an image!')</script>
 <?php
  }else{ ?>
  <script type='text/javascript'>alert('Wait for admin confirmation! Check your email     within 24 hours')</script>
   <?php
    move_uploaded_file($_FILES["image"] ["tmp_name"], "images/" . $_FILES["image"]["name"]);
$fullname= $_POST['name'];

$course=$_POST['course'];
$yeargrad=$_POST['year'];
$img=$_FILES['image']["name"];
$email=$_POST['email'];

        mysql_query("INSERT INTO tblreg(fullname,course,
        year_grad,img,email,username,password,status)



        VALUES('$fullname',
             '$course', '$yeargrad','$img', '$email', 'no', 'no', 'not')");

         header('location:reg.php');
         } 
         }
         ?>

1 个答案:

答案 0 :(得分:0)

由于重定向(header('location:reg.php')

警告未显示