lundi 30 mars 2020

How to fix an unexpected end of file error in php source code [duplicate]

I am just creating a login page. On this page when I try to login by entering username and password, it shows me unexpected end of file error. Please, anyone correct what is the mistake in the source code.

I have closed html tags. I have closed PHP and also parenthesis. Still, I am getting same kind of error.

<html>
<body bgcolor="#00CCFF">
<center>
<?php
$email=$_POST[ 'email' ];
$pwd=$_POST[ 'pwd' ];
$sql="select * from tblsocialconnect where email='$email' and password='$pwd'";
$dbserver="localhost";
$dbusername="ff_user";
$dbpassword="123";
$dbname="ff_user";
$dbconn=mysqli_connect($dbserver,$dbusername,$dbpassword);
$db=null;
$db=mysqli_select_db($dbname,$dbconn);
$resultval=mysqli_query($sql,$dbconn);
if(mysqli_num_rows($resultval)<=0){
?>
<br /><p style="color:red">Invalidusername or password</p><br/>
<a href="socialmediaconnect.php">Click to go back</a>
<?php}
else 
echo"<h1>Authenticated successfully</h1>";
mysqli_close($dbconn);
?>
</center>
</body>
</html>

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\login2\handlelogin.php on line 29




Aucun commentaire:

Enregistrer un commentaire