Deprecated: Function eregi() is deprecated in C:\xampp\htdocs\user_registration\send-password.php on line 4 -


<?php  $email = $_post["email"]; $email_test = eregi("^([a-za-z0-9_-]+)(\.[a-za-z0-9_-]+)*@([a-za-z0-9_-]\.)*([a-za-z0-9_-]+)\.[a-za-z]{2,}$", $email);  if($email_test){     include("db.inc.php"); //file important mysql information      $server_un = 'ddagar251'; //username of website email address (change own) ex: admin     $domain = $_server["gmail.com"]; //domain name extension; ex: (wcetdesigns.com)     $server_email = $server_un.'@'.$domain; //your website's email address      $query = mysql_qenter code hereuery("select * register email='".$email."'");     $numrow = mysql_num_rows($query);     $result = mysql_fetch_assoc($query);      if($numrow&&$result["email"]){         $to = $email;         $subject = "forgot password";         $headers = "from: site <".$server_email.">\r\n";         $headers .= "content-type: text/html\r\n";         $message = "you have requested forgot password.<br>                     password: <b>".$result["password"]."<b>";          mail($to, $subject, $message, $headers);          echo 'password sent <b>'.$email.'</b>';     } } else {`enter code here`     echo 'invalid email'; }  ?> 

use preg_match insted of eregi this:

$email_test = preg_match("/^([a-za-z0-9_-]+)(\.[a-za-z0-9_-]+)*@([a-za-z0-9_-]\.)*([a-za-z0-9_-]+)\.[a-za-z]{2,}$/i", $email); 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -