Jump to content

User Registration

Recommended Posts


Can anyone help with this problem it seems very simple, I am not an experienced PHP coder but keen to progress.

I am trying to create a User Registration project but have a problem. every time I try to login using  mysqli_fetch_assoc it drops through to my error Invalid Email /Password it seems that the mysqli code is not working correctly but I do not understand this function enough can anyone help. I have attached the coding if this helps.

This is the function

function Login_Attempt($Email,$Password){
    $Query="SELECT * FROM admin_panel WHERE email='$Email'";
            echo $Email;
             return $admin ;
        return null;    }


This is the code I am using 


<?php require_once("Include/Session.php"); ?>
<?php require_once("Include/Styles.css"); ?>
<?php require_once("Include/Functions.php"); ?>
<?php require_once("Include/DB.php"); ?>
    $_SESSION["message"]="All Fields must be filled out";
        $_SESSION["message"]="Invalid Email / Password";

    $_SESSION["message"]="Account Confirmation Required";
<?php ?>
<?php echo Message(); ?>
<?php echo SuccessMessage(); ?></div>
<div id="centerpage">
<br><a href="User_Registration.php"><span class="FieldInfo">Don't Have an account? Creat One !</span></a><br>
    <form action="Login.php" method="post">
<span class="FieldInfo">Email:</span><br><input type="email" Name="Email" value=""><br>
<span class="FieldInfo">Password:</span><br><input type="password" Name="Password" value=""><br>
<input type="checkbox" Name="Remember" ><span class="FieldInfo"> &nbsp;Remember me<span class="FieldInfo"><br>
<br><a href="Recover_Account.php"><span class="FieldInfo">Forgot Password</span></a>

<br><input type="Submit" Name="Submit" value="Login"><br>

Hope this Helps 




Share this post

Link to post
Share on other sites

You are not passing $Connection to the function so it is undefined. If you had errors turned on you would have seen that.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.