Welcome on login

i cant display login message nothing is coming out

		$password = $_POST['password'];
		$sql = "select 	email from users where email = '".$email."'";
	$rs = mysqli_query($conn,$sql);
	$numRows = mysqli_num_rows($rs);
	if($numRows  == 1){
		$row = mysqli_fetch_assoc($rs);
			echo 'welcome' .$row['email'];	


Can you post your email_verify function as well please?

1 Like

The logic here just makes no sense at all. OP, let me suggest that you put down the coding for a minute and study lots of different login scripts. While some may not be the best or necessarily correct you will see a pattern emerge. You cant write a script if you do not understand the logic needed to do it.

Where does the value of $email come from? What is the value of $numRows when you run the code? Doesn’t there need to be some password verification as well, before logging the user in, or is that to be added once you have the email retrieval working?

For debugging, you could make your “failure” message echo something, so if you get a blank screen you can distinguish between something silently failing, and failing to match the email in the database.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.