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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:06:31+00:00 2026-06-15T00:06:31+00:00

I’m making a flat file login system and when I click the submit the

  • 0

I’m making a flat file login system and when I click the submit the button on the login.php page it goes to protected.php and returns Internal Server Error, but when I just load the protected.php page without using the form everything turns out fine.

login.php

<html>
    <link rel="stylesheet" type="text/css" href="style.css">
    <body>
        <center><img src="logo.png"></center>
        <div id="login">
            <form action="protected.php" method="post">
            </br>
            Username  <input type="text" name="user" class="text"/>
            <p></p>
            Password <input type="password"" name="pass" class="text" />
            <p></p>
                <input type="submit" value="Login" class="button">
            </form>
        </div>
    </body>
</html>

protected.php

<?php
$usr = "admin";
$pass = "admin";

$iusr = $_POST["user"];
$ipass = $_POST["pass"];

if ($iuser !== $usr || $ipass !== $ipass) {
?>
<html>
<script type="text/javascript">
<!--
window.location = "login.php"
//-->
</script>
</html>
<?php
}
?>
<html>
    <link rel="stylesheet" type="text/css" href="style.css">
    <body>

    </body>
</html>

Please help! Thanks in advance!

  • 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-15T00:06:32+00:00Added an answer on June 15, 2026 at 12:06 am

    The "Internal Server Error" could mean several things, but most likely means an error in your PHP code. This will require setting the display_errors property to "1" in your php.ini. The problem might also be a startup error, so you may wish to also consider the display_startup_errors property.

    http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors

    Two comments about the code, unrelated to your question: 1) the expression $ipass !== $ipass seems like a typo, as it will always return FALSE, and 2) this "security" is easily bypassed by turning javascript off. Consider using header() for redirects instead.

    https://www.php.net/manual/en/function.header.php

    EDIT: … in this specific case, the error is use of the variable $iuser, which is undefined. You’d previously declared it as $iusr. Turning on error reporting or looking at the log will present you with good error messages to find these sorts of problems easily.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a reasonable size flat file database of text documents mostly saved in
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported

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.