0

I am practicing Android Studio with MySql and i have trying a Php Script

   <?php
require "connect.php";
$userid = "pranav.gundra29@gmail.com";
$code=mt_rand(100000, 999999);
$mysql_qry = "select * from userinfo where userid = '$userid';";
$query = mysqli_query($conn ,$mysql_qry);

if(mysqli_num_rows($query)==1){
 $row = mysqli_fetch_array($query);
 $username = $row['username'];
$inserted= mysqli_query($conn, "UPDATE userinfo SET password recovery='$code' WHERE userid = '$userid' ");


$to = "$userid";
$subject = "reset password link";
$header = "From: pranav@example.com". "\r\n" .
$body = "Hi $username your password reset link
To reset the password please click on the below link:
$code;

$sent=mail($to,$subject,$body,$header);

if($inserted) {

echo ' check your mail we have sent you reset link to change your password! <br>';
}


} else {
  echo ' Failed To Login ';
}


<?

I have used "<?php" at the end of file but still the same error

Please help where i am missing

0 Answers0