I am getting the following error when i try to log on to my data base
the code i have is
[php]
<?php
include('vistac config.php');
// Define $myusername and $mypassword
$myusername=$_P OST['myusername'];
$mypassword=$_P OST['mypassword'];
$sql="SELECT * FROM $tbl_name WHERE username='$myus ername' and password='$mypa ssword'";
$result=mysql_q uery($sql);
// Mysql_num_row is counting table row
$count=mysql_nu m_rows($result) ;
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success. php"
session_registe r('myusername') ;
session_registe r('mypassword') ;
header("locatio n:login_success .php");
}
else {
echo "Wrong Username or Password";
}
ob_end_flush();
?>
[/php]
i cannot find the error and the more i look the more i caannot see
can any body help me please
thanks
Code:
Warning: session_register() [function.session-register]: Cannot send session cookie - headers already sent by (output started at D:\virtualservers\182763\root\test\login\checklogin.php:1) in D:\virtualservers\182763\root\test\login\checklogin.php on line 18 Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at D:\virtualservers\182763\root\test\login\checklogin.php:1) in D:\virtualservers\182763\root\test\login\checklogin.php on line 18 Warning: Cannot modify header information - headers already sent by (output started at D:\virtualservers\182763\root\test\login\checklogin.php:1) in D:\virtualservers\182763\root\test\login\checklogin.php on line 20 Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
[php]
<?php
include('vistac config.php');
// Define $myusername and $mypassword
$myusername=$_P OST['myusername'];
$mypassword=$_P OST['mypassword'];
$sql="SELECT * FROM $tbl_name WHERE username='$myus ername' and password='$mypa ssword'";
$result=mysql_q uery($sql);
// Mysql_num_row is counting table row
$count=mysql_nu m_rows($result) ;
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success. php"
session_registe r('myusername') ;
session_registe r('mypassword') ;
header("locatio n:login_success .php");
}
else {
echo "Wrong Username or Password";
}
ob_end_flush();
?>
[/php]
i cannot find the error and the more i look the more i caannot see
can any body help me please
thanks
Comment