Warning: Cannot modify header information - headers already sent by (output started at /home/content/08/8207708/html/connect.php:11) in /home/content/08/8207708/html/check_login.php on line 17
When i try to log into my site online.
<?php
include('connect.php');
$tbl_name="users";
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
session_start();
session_register("myusername");
session_register("mypassword");
header("location:index2.php");}
else {
echo "Wrong Username or Password";
}
?>
There are no spaces at the beginning or at the end. and i cleared all white space between the lines to make sure. I can put the session_start at the beginning but.. then how can i check the password is correct or not if it comes before the other stuff. Bit confused on this as it works on Xampp but when i try online i get the error.

New Topic/Question
Reply



MultiQuote





|