Jump to content

Slight Problem Of This Code So Please Tell Me Solution


KumarArvind

Recommended Posts

Hello Admin

 

I have slight problem of this code so please tell me solution of this.

message is below:

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\deals\connection.php:8) inC:\xampp\htdocs\deals\checklogin.php on line 11

 

Code is below :-

 

<?php session_start(); ?>

<!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=iso-8859-1" />

<title>Index</title>

</head>

<body>

<table height="250px"></table>

<center>

<table width="300" border="0" align="center" cellpadding="8" cellspacing="1" bgcolor="#CC6666">

<tr>

<form name="form1" method="post" action="checklogin.php">

<td>

<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#66CCCC">

<tr>

<td colspan="3"><strong>Member Login </strong></td>

</tr>

<tr>

<td width="78">Username</td>

<td width="6">:</td>

<td width="294"><input name="myusername" type="text" id="myusername"></td>

</tr>

<tr>

<td>Password</td>

<td>:</td>

<td><input name="mypassword" type="text" id="mypassword"></td>

</tr>

<tr>

<td> </td>

<td> </td>

<td><input type="submit" name="Submit" value="Login"><input type="checkbox" name="checkbox"/>Stay signed in</td>

</tr>

</table>

</td>

</form>

</tr>

</table>

</center>

</body>

</html>

Mysql Code

<?php

$myusername=$_POST["myusername"];

$mypassword=$_POST["mypassword"];

include('connection.php');

mysql_connect("$host", "$username", "$password")or die("cannot connect");

mysql_select_db("$db_name")or die("cannot select DB");

$sql="SELECT * FROM admin WHERE myusername='$myusername' and mypassword='$mypassword'";

$result=mysql_query($sql);

$count=mysql_num_rows($result);

if($count==1){

header("location:admin_home.php");

}

else {

echo "Wrong Username or Password";

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.