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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:25:44+00:00 2026-06-16T03:25:44+00:00

Could somebody please help me implement this HTML with my PHP login Page? For

  • 0

Could somebody please help me implement this HTML with my PHP login Page?
For some reason, the page is unresponsive.

Here is the HTML code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <link rel="stylesheet" href="css/screen.css" type="text/css" />
    <!--[if ite - 8]><link rel="stylesheet" href="css/screen_ie.css" type="text/css" /><![endif]-->
    <meta http-equiv="content-type" content="text/html; charset=windows-1251" />
    <title>Index</title>
</head>
<body>
    <div id="block">
        <div class="logo"><img src="img/logo.png" alt="" /></div>
        <div class="form">
            <p class="login-box">Login box</p>
            <div class="warning"><p>Wrong password, please try again.</p><p class="c">&nbsp;</p></div>
            <input type="text" value="Username"/>
            <input type="text" value="*******"/>
            <p class="btn">
                <input type="button" value="Login"/>
            </p>
            <ul class="nav-path">
                <li><a href="#">Forgot your password?</a></li>
                <li><a href="#">Create new account</a></li>
            </ul>
            <i class="ctop">&nbsp;</i>
            <i class="cbottom">&nbsp;</i>
        </div>
    </div>
</body>
</html>

And here is the current PHP login page with a temporary form:

<?php
include("db.php");
session_start();
if($_SERVER["REQUEST_METHOD"] == "POST")
{
// username and password sent from Form
$username=mysql_real_escape_string($_POST['username']); 
$password=mysql_real_escape_string($_POST['password']); 
$password = sha1($password);
$sql="SELECT * FROM client_login WHERE Username='$username' and Password='$password'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
$row = mysql_fetch_array($result);
$client_ref = $row['Client_ref'];
$user_level = $row['user_level'];
// If result matched $username and $password, table row must be 1 row
if($count==1)
{

$_SESSION['user_level'] = $user_level;
$_SESSION['client_ref'] = $client_ref;
$_SESSION['user'] = $username;

if ($user_level == '1') {
header('Location: admin.php');
} else {

header('Location: myaccount.php');
}
}
else 
{
echo "Error logging in!";
}
}
?>
<form action="login.php" method="post">
<label>UserName :</label>
<input type="text" name="username"/><br />
<label>Password :</label>
<input type="password" name="password"/><br/>
<input type="submit" value=" Login "/><br />
</form>

Any suggestions or ideas would be greatly appreciated.

  • 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-16T03:25:45+00:00Added an answer on June 16, 2026 at 3:25 am

    There appears to be multiple problems with your code that you posted. For starters as I stated above in a comment, I don’t recognize the conditional comment ite - 8. Make sure that comment is correct and use this site as a reference.

    In addition, you are trying to send input with no form. A div with a class="form" is not the same as an actual form. Inside <div class="form"> add the following:

    <form name="loginForm" id="loginForm" action="" method="post">
    

    Fill in action with the page you are posting to.

    After this line: <i class="cbottom">&nbsp;</i> add a closing form tag like so:

    </form>
    

    Finally, change your button from type="button" to type="submit".

    So to recap, check the conditional comment. This shouldn’t stop your page from loading however. Your main problem was your lack of a form. When you try to submit inputs for posting you need to have a form. The form tells the page:

    • the method to use when submitting your request GET or POST
    • and the page to post to in the action="" tag

    There are additional attributes that the form can provide but they aren’t relevant to your login form.

    Finally, in order for a form to be posted to the respective page, a submit action has to be fired. Buttons can have a type of button or submit. If you use type="button" it is up to you to wire up an event to trigger when the button is clicked in the onclick="" attribute.

    For your purposes, you only need to submit your page and let the PHP do the rest. So for simplicity sake use type="submit" as it performs a submit of the page without you having to wire up an appropriate function.

    Try these things first and let me know if you are still having issues. Happy Coding!

    EDIT (ADDITIONAL ERRORS):

    Another error I see is that your input fields do not have name attributes. When a form is posted the name attributes are sent through the respective stream (GET or POST). If no names are attached to the inputs, they will not be added to the stream.

    It appears your PHP is expecting $_POST['username'] for the username input so add:

    name="username"
    

    to your username input field. It also appears that your PHP is expecting $_POST['password'] for the password field so add:

    name="password"
    

    to your password input. Also change the type on the password input from text to password. If you want the most basic of security and want anyone to join your site at least hide their password while they type it.

    I recommend you start researching HTML and PHP by either purchasing a book on the topic(s) or by visiting a site such as W3Schools so you can learn and understand the basics of web design especially HTML as this is the base that you will be building on.

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

Sidebar

Related Questions

Was wondering if somebody could please help me solve this. I've follwed all steps
Please Please Please could somebody help me finish implementing the code below. I followed
Good day, please could somebody help me find out what's wrong with my code.
Could somebody please help me get Clang up and running? (I don't have 3.2)
could somebody please take a look at this http://jsfiddle.net/bloodygeese/EzkFR/1/ My aim is to on
Could somebody please explain what this notation is in javascript? What is function(d) doing?
Could somebody please take some time to show me a quick example on how
Could somebody please help me understand the concept of 'impersonation'? The way I understand
Could somebody please help me setup Emacs Tramp to do a double hop? I
Could somebody please help me with explode() function. I am reading values with $_POST[]

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.