Link to home
Start Free TrialLog in
Avatar of Jazzy 1012
Jazzy 1012

asked on

Php variable to be sent back

I have this code to send an email to the user:

if(!empty($email)){
	
	$q_check = "SELECT * FROM users WHERE email = '$email'";
	$check = mysqli_query($conn,$q_check);
	$row = mysqli_fetch_array($check);
	$name = $row['first_name'];
	$createdat=  date("Y-m-d H:i:s");	
	if($row)
	{
	
		$res = mail ($email, $subject, $body,$headers);
		header("Location: index.php/?a=1");
		//echo "Please check your email";
	}
	

Open in new window


How can I make the email be sent back to the previous page so it can say it has been sent back to jasmine@hotmail.com

    			<?php
    			if($_GET['i'] == 1)
    			{?>
    				<p style= 'color: red'>A reset email has been sent to </p>
    			<?php 
    			}
    			if($_GET['i'] == 2)
    			{
    				echo " <p style= 'color: red'>The email you entered in invalid</p>";
    			}
    			?>

Open in new window

Avatar of Mukesh Yadav
Mukesh Yadav
Flag of India image

Instead of doing this use the session.
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial