Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Login</title>
- <link href="css/usercss.css" rel="stylesheet" type="text/css" />
- <style type="text/css">
- <!--
- body {
- background-image: url(images/LoginForm_bg.jpg);
- background-repeat: repeat;
- }
- -->
- </style></head>
- <body>
- <div class="shadow" id="login">
- <div id="login-body">
- <form action="login.php" method="post" name="loginform">
- <strong>Username:</strong>
- <input name="username" type="text" class="input" value="username" maxlength="10" />
- <p><br />
- <strong>Password:</strong>
- <input name="password" type="password" class="input" value="password" />
- <p><br />
- <input type="submit" name="submit" value="Login" width="30" class="myButton">
- </form>
- <p> <br />
- <?php
- ob_start();
- @session_start();
- include'include/config.php';
- include'include/opendb.php';
- @$username=$_POST['username'];
- @$password=$_POST['password'];
- if($username&&$password)
- {
- $connect=mysql_connect("$dbhost","$dbuser","$dbpass")or die("Couldnt connect to Database");
- mysql_select_db("$dbname") or die ("Could not find to Database");
- $query = mysql_query ("SELECT * FROM user WHERE username='$username'");
- $numrows = mysql_num_rows($query);
- if ($numrows != 0)
- {
- while ($rows = mysql_fetch_assoc($query))
- {
- $dbusername = $rows['username'];
- $dbpassword = $rows['password'];
- }
- if($username==$dbusername&&$password==$dbpassword)
- {
- header("location:main.php");
- $_SESSION['username']=$dbusername;
- }
- else
- die("<p class=error>* Increate Password</p>");
- }
- else die("<p class=error>* The username doesnot exist</p>");
- }
- else die ("<p class=text>* Please entre a username and password</p>");
- ?>
- </div>
- </div>
- </body>
- </html>
- <?php
- ob_start();
- session_start();
- ?>
- <!DOCTYPE....
- <?php
- session_start();
- ?>
- <html>
- <!-- Output -->
- </html>
- <?php
- ob_start();
- ?>
- <html>
- <!-- Output -->
- </html>
- <?php
- session_start();
- ob_flush();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement