Jump to content

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";

}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.