Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6822283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:38:41+00:00 2026-05-26T21:38:41+00:00

every time click login it return me to the login screen this is my

  • 0

every time click login it return me to the login screen

this is my first code to login

    <form action="" method="post" name="log">
    <table border="0" align="center">
  <tr>
    <td colspan="4"><span style="font-size:18px; color:#039; font-weight:bold;">Login</span></td>
    </tr>
  <tr>
    <td width="113">User name</td>
    <td width="120"><span id="sprytextfield1">
      <input name="Uname" type="text" id="LogInUname" size="20" />
      <span class="textfieldRequiredMsg"><br />
      A value is required.</span></span></td>
    </tr>
  <tr>
    <td>Password</td>
    <td><span id="sprypassword1">
      <input name="Pword" type="password" id="LogInPword" size="20" />
      <br />
      <span class="passwordRequiredMsg">A value is required.</span></span></td>
    </tr>
  <tr>
    <td><span class="newUsers"><a href="index.php?learn_id=88">New user</a></span></td>
    <td></td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="right"><input type="submit" name="submitid" id="LogInbutton" value="Login" /></td>
  </tr>
  </table>

</form>

<?php
session_start();
    if(isset($_POST['submitid'])) {
        $Uname = $_POST['Uname'];
        $Pword = $_POST['Pword'];


            $Uname = stripslashes($Uname);
            $Pword = stripslashes($Pword);
            $Uname = mysqli_real_escape_string($db, $Uname);
            $Pword = mysqli_real_escape_string($db, $Pword);

            $loginUser = " select * from loginaccess where Uname= '".$Uname."' and Pword='".$Pword."'";

            $loginUserResults=$db->query($loginUser) or die($db->error);

            if($loginUserResults -> num_rows == 1) {
                $_SESSION['log']=1;
            header('Location:index.php?learn_id=12');

                }else{

            header('Location:index.php?learn_id=320');
            }
        }

?>

<?php ob_flush() ?>

and this is the other page that it should go to

<?php 
session_start();
        if (!(isset($_SESSION['log']) && $_SESSION['log'] != 1)) {
        header ("Location:index.php?learn_id=3");
    }       
?>

now please some one tell me why I am every time try to login I return to the login page what is wrong there.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:38:42+00:00Added an answer on May 26, 2026 at 9:38 pm

    First: This line

    $_SESSION['log']==1; // compare
    

    should be

    $_SESSION['log']=1; // assign
    

    Second: I don’t see the session_start(); at the very top of your first page (login)

    Third: Do not use both stripslashes and mysqli_real_escape_string. The latter is enough (better if you use a PDO).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Every time you start Visual Studio, the first time you click Add Reference to
Every time I call this method my NSMutableData is leaking and I cannot figure
I have a RichTextBox that I write a string to every time I click
I am trying to implement the MVP method for the first time, using WinForms.
I have an application configured with authlogic and authlogic_facebook_connect, but every time I click
I have following flow of app : First screen is Login screen and if
Every time I turn on my company-owned development machine, I have to kill 10+
Every time I create a new project I copy the last project's ant file
Every time I create an object that has a collection property I go back
Every time I need to work with date and/or timstamps in Java I always

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.