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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:48:03+00:00 2026-06-09T21:48:03+00:00

The code works once but then it will not load the customer_login.php page again.

  • 0

The code works once but then it will not load the customer_login.php page again. It gives HTTp 404 Not Found error when I try for a second time. Between the time it was working and got the error, I did not change anything.

    <?php
session_start();
if(isset($_SESSION["manager"]))
    {
        header("location: ./admin/website/".$websitelocation."/index.html");
        exit();
    }
     ?>
     <?php
if(isset($_POST["username"])&&isset($_POST["password"]))
    {
        $manager = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["username"]); 
        $password = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["password"]); 

        include "./scripts/connect_to_mysql.php";
        $sql = mysql_query("SELECT UsersID, Active, Website_Location  FROM users WHERE       User_Name='$manager' AND Password='$password' LIMIT 1") or die(mysql_error());

        $existCount = mysql_num_rows($sql);
        echo $existCount;

        if ($existCount == 1) 
                {
                    while($row = mysql_fetch_array($sql))
                        { 
                            $id = $row["UsersID"];
                            $active = $row["Active"];
                            $websitelocation = $row["Website_Location"];                            
                        }
                    if($active == 'Yes')
                    {   
                        $_SESSION["id"] = $id;
                        $_SESSION["manager"] = $manager;
                        $_SESSION["password"] = $password;

                        header("location: ./admin/website/".$websitelocation."/index.html");

                        exit();
                    }
                    else
                    {
                        echo "<script type='text/javascript'>alert('You are not authorized to login!!!!');</script> ";

                        echo "click here to go back to <a href='admin_login.php'>login page</a>. <br><br>"; 
                        echo "click here to go to <a href='../customer_login.php'>customer login</a>. <br><br>";
                        echo "click here to go to <a href='../index.php'>JE Designs LLC main page</a>. <br><br>";                               

                        exit();
                    }
                } 
                else 
                {
                    echo "<script type='text/javascript'>alert('The information you have entered is not correct, please try again.');</script> ";

                    echo "<a href=\"javascript:history.go(-1)\">Go back to login page.</a>"; 


                    exit();
                }

    }
     ?>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>User Login</title>
    </head>

    <body>
    <div align="center" id="mainWrapper">
    <?php include_once("template_header.php");?>
    <div id="pageContent"><br />
<div align="left" style="margin-left:24px;">
  <h2>Log in to view website.</h2>
  <form id="form1" name="form1" method="post" action="
  <?php 
    if(isset($_POST["username"])&&isset($_POST["password"]))
        {
            echo "./admin/website/".$websitelocation."/index.html"; 
        }
        else
        {
            echo "customer_login.php";
        }
  ?> " >
    User Name:<br />
      <input name="username" type="text" id="username" size="40" />
    <br /><br />
    Password:<br />
   <input name="password" type="password" id="password" size="40" />
   <br />
   <br />
   <br />

     <input type="submit" name="button" id="button" value="Log In" />

  </form>
  <p>&nbsp; </p>
</div>
<br />
<br />
<br />
</div>
<?php include_once("template_footer.php");?>
</div>
</body>
</html>    
  • 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-09T21:48:05+00:00Added an answer on June 9, 2026 at 9:48 pm

    When you are already logged in, you redirect to ./admin/website/$websitelocation/index.html. But where does the variable $websitelocation come from? It does not help if you set this variable in the login script! So you will be redirected to ./admin/website//index.html, and this gives you the 404.

    BTW: Don’t use relative redirections, it is best practice to include the hostname in the Location header, because that is more widely supported.

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

Sidebar

Related Questions

This code works (when ControlType=dropDown then the background yellow ): <Window x:Class=TestCollapsed.Views.MainView xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
This code works for me except it only checks for a duplicate once, and
This code works well for displaying separate xml items in my main.xml. But is
This code works fine, but I'll want to handle exception if any thing goes
I am using load() to grab a section of a .php page and replace
This code works well: UIDatePicker *pickerView = [[UIDatePicker alloc] initWithFrame:pickerFrame]; [pickerView addTarget:self action:@selector(pickerChanged:) forControlEvents:UIControlEventValueChanged];
This code works fine in Chrome. However, in Firefox, when it hits the GMxhr
This code works: monkey.h @interface monkey : NSObject { NSNumber *monkeyRanch; } @property (nonatomic,
this code works fine until I start scrolling: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
This code works: class Test { public: Test(string name) : _name(name) {}; bool operator()()

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.