希望在提醒框中添加样式


want to add style on alert box

我想在注册后发送一封邮件,但它不起作用,我不知道出了什么问题,可以帮我解决吗

javascript

// WRITE THE VALIDATION SCRIPT IN THE HEAD TAG.
function isNumber(evt) {
  var iKeyCode = (evt.which) ? evt.which : evt.keyCode
  if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57))
    return false;
  return true;
}

html+php

<html>
  <body>
    <form name="reg"  action="code_exec.php"  method="post">
      <table width="274" border="0" align="center" cellpadding="2" cellspacing="0">
        <tr>
          <td colspan="2">
            <div align="center">
              <?php 
                $remarks=$_GET['remarks'];
                if ($remarks==null and $remarks=="") {
                  echo 'Register Here';
                }
                if ($remarks=='success') {
                  echo 'Registration Success';
                }
              ?>    
            </div>
          </td>
        </tr>
        <tr>
          <td width="95"><div align="right">Mobile_no:</div></td>
          <td width="171"><input type="text" ID="tbNumbers" name="mobile_no" required maxlength="10" onkeypress="javascript:return isNumber(event)" /></td>
        </tr>
        <tr>
          <td><div align="right">Name:</div></td>
          <td><input type="text" name="name" required/></td>
        </tr> 
        <tr>
          <td><div align="right">E_mail:</div></td>
          <td><input type="text" name="e_mail" E_MAIL required pattern="[a-z0-9._%+-]+@[a-z0-9.-]+'.[a-z]{2,3}$" /></td>
        </tr>
        <tr>    
          <td><div align="right">Password:</div></td>
          <td><input type="password" name="password" required pattern="(?=.*'d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters"/></td>
        </tr>
        <tr>
          <td><div align="right"></div></td>
          <td><input name="submit" type="submit" value="Submit" /></td>
        </tr>
      </table>
    </form>
    <!-- Javascript -->
    <script src="assets/js/jquery-1.8.2.min.js"></script> 
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/js/jquery.backstretch.min.js"></script>
    <script src="assets/js/scripts.js"></script>
  </body>
</html>

我想在注册后发送一封自动生成的客户id邮件

<?php
session_start();
$con       = mysqli_connect("retail", "RS", "orbisindia", "rs");
$mobile_no = $_POST['mobile_no'];
$name      = $_POST['name'];
$e_mail    = $_POST['e_mail'];
$password  = $_POST['password'];
$Cust_Id   = time();
$message   = "";
try {
        // execute the stored procedure
        $sql = mysqli_query($con,"CALL sp_retail_reg('$Cust_Id','$mobile_no','$name','$e_mail','$password')");
 if(!empty($Cust_Id)) {
$toEmail = $_POST['e_mail'];
$subject = "Thank you for registration";
$content = "your Custotmer id is" . $Cust_Id ;
    $content1 = "your Password is" . $password ; 
$mailHeaders = "From: rohit.jha@99rstreet.com";
if(mail($toEmail, $subject, $content,$content1, $mailHeaders)) {
    $message = "You have registered and your cutomer id  is sent to your email. plze check spam Also."; 
}
unset($_POST);

}

    } catch (PDOException $pe) {
        die("Error occurred:" . $pe->getMessage());
    }

$消息="您的Cust_Id=$Cust_Id";echo"alert('$message');window.location.href='home.php';";

从code_exec.php中删除window.location.href,其中customerid被警告

echo "<script>alert('$message'); window.location.href='home.php';</script>"

它在调用student_ confirmation函数之前重定向到home.php。您可以在调用student_confirmation函数后编写它。