0
 <?php

if(isset($_POST['submitregister']))
{
    include('lib/connection.php');

    $email=$_POST['email'];
    $username=$_POST['username'];
    $password=$_POST['password'];

    $sql=" INSERT INTO users (Email,UserName,Password) VALUES('$email','$username','$password')";

    $result=mysqli_query($conn,$sql) or die("The query is not correct");

    if($result)
    {
        echo "<script>alert('You have been registered');</script>";
    }
    else
    {
        echo "<script>alert('Error in registration');</script>";
    }


}

if(isset($_POST['submitlogin']))
{
    include('lib/connection.php');

    $username=$_POST['username'];
    $password=$_POST['password'];

    $sql="SELECT ID FROM users WHERE UserName='$username' AND Password='$password'";

    $result=mysqli_query($conn,$sql) or die("The query is not right");

    $row=mysqli_num_rows($result);

    if($row==1)
    {
        echo "<script>alert('You are logged in');</script>";
    }
    else{

        echo "<script>alert('You are not logged in');</script>";

    }

}

if(isset($_POST['submitsearch']))
{
    include('lib/connection.php');
    $searched=$_POST['search'];

    $sql="SELECT * FROM users WHERE UserName='$searched'";

    $result=mysqli_query($conn,$sql) or die("The query is not right");

    $row=mysqli_num_rows($result);

    while($row=mysqli_fetch_array($result,MYSQLI_ASSOC))
    {?>

       <table>
            <tr>
                <td><?php echo "$row[ID]";?></td>
                <td><?php echo "$row[UserName]";?></td>
                <td><?php echo "$row[Password]";?></td>
            </tr>
       </table>    


    <?php}?>
<?php}?>

The output is not displayed

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\CMS\processing.php on line 80

error is coming in the php code i have written my php file so tell me the solution of this problem

what is the solution of this problem?

0 Answers0