Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Warning: Cannot modify header information - headers already sent by (output started at /home4/jachun39/public_html/ap/login.php:6) in /home4/jachun39/public_html/ap/login.php on line 22
- <?php
- include('SqlConnect.php');
- ?>
- <link rel="Stylesheet" type="text/css" href="style.css" />
- <link href='http://fonts.googleapis.com/css?family=Karla:400,700,700italic,400italic' rel='stylesheet' type='text/css'>
- <?php
- if (isset($_POST['Login'])){
- if (!@mysql_connect($host, $username, $password)) die("Can't connect to database");
- if (!mysql_select_db($db_name)) die("Can't select database");
- $username=$_POST['username'];
- $password=$_POST['password'];
- $username = stripslashes($username);
- $password = stripslashes($password);
- $username = mysql_real_escape_string($username);
- $password = mysql_real_escape_string($password);
- $sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'";
- $result=mysql_query($sql);
- $count=mysql_num_rows($result);
- if($count >= 1){
- $_SESSION['username']= "username";
- $_SESSION['password']= "password";
- header("location: index.php");
- echo "<center><font color='green'><b>Logged in Successfully</center></font></b>";
- } else {
- echo "<center><font color='red'><b>Wrong Username or Password</center></font></b>";
- }
- }
- <?php
- if(!isset($_SESSION['username'])){
- header("location: login.php");
- }
- ?>
- ob_start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement