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 9008315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:54:42+00:00 2026-06-16T01:54:42+00:00

I have a login page called signin.php where a user can enter an email

  • 0

I have a login page called signin.php where a user can enter an email and password. On clicking submit button, page directs to connection_validate.php. This page validates the user entered data with database. If it’s a registered user, the page directs to calendar.php. If the entered data is incorrect, it should redirect to signin.php. If the entered data is incorrect, I have placed cookie like this:

//action to be done if e mail id and password matches with database records             
if(mysql_num_rows($result)>0)
{
    header('location:calendar.php');
}
//action to be done if e mail id and password does not matches with database records 
else
{
    setcookie('message','incorrect login data');
    header('location:signin.php');
}

In signin.php, I have written the code for displaying an alert if login information is incorrect like this:

<?php
include("include/minfooter.php"); 
if(isset($_COOKIE["message"]))
{
    if(!($_COOKIE["message"]==" "))
    {
        echo "<script>
    alert('Incorrect login information');
    </script>";
    setcookie("message"," ",time()-3600);
    }
}
?>

My issue is that alert is displaying each time when I load the signin page if I have entered a error login data once. If I press the back button from the calendar.php to signin.php also, alert starts showing. I understood that the problem is with cookie. Cookie has not been removed. How can I solve this issue?

  • 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-06-16T01:54:43+00:00Added an answer on June 16, 2026 at 1:54 am

    Update your signin.php as follows

    <?php
        include("include/minfooter.php");
        if (isset($_COOKIE["message"]))
        {
    
            echo "<script>
                    var delete_cookie = function(name) {
                        document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
                    };
                    var msg = '" . $_COOKIE["message"] . "';
                    if (msg != '')
                        alert('Incorrect login information');
                    delete_cookie('message');
                </script>";
        }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Normally we have login page with username, password filed and signin button. Using the
I have an AuthorizationServlet which is called when user click button in login page.
I have a login page. When the user enters valid Username and Password another
I have a (HTTPS) login.php page which remains HTTPS (ie once user logged in
Hi i have developed a login form (username,password and submit button) using a MySQL
I have a login page that return the userName to a page called User.aspx.
I have a Login page that captures User input like this. MD5calc ss =
Scenario: I have a login page which uses ajax to validate a user and
I have a php function in a php page called encrypt_password that I use
I have having difficulties on this one page login.php. Because of the nature of

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.