Hi please help to get rid of this error/warning...
Please see the following code carefully..
Look at the errors first
-------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home/compkcom/public_html/includes/config.php:1) in /home/compkcom/public_html/cmpanel/check_login.php on line 20
-------------------------------------------
here goes the php script
---------------
<?php
session_start();
?>
<?php
if((isset($_POST['username'])&&$_POST['username']!="")&&(isset($_POST['password'])&&$_POST['password']!="")){
$error='';
require('../includes/config.php');
$conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die('Could not connect to MySQL database. ' . mysql_error());
mysql_select_db(SQL_DB,$conn);
$query = "SELECT COUNT(username) AS record FROM admin WHERE username ='" . $_POST['username']."' AND password = '".$_POST['password']."'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
if($row['record']==1){
$_SESSION['user_logged'] = $_POST['username'];
$_SESSION['user_password'] = $_POST['password'];
header("location:welcome.php");
}
else{
$error .="Please+Enter+Correct+Username+and+password%21%0D%0A";
header("location:index.php?&error=".$error);
}
}
else{
$error .="Please+Enter+the+Username+and+password+First%21%0D%0A";
header("location:index.php?&error=".$error);
}
?>
----------------
This script is working fine on my local window server, but on my linux hosted server it is giving warning..
Warning is coming because because of inclusion of require('../includes/config.php');
but inclusion of this file is necessary, please help to solve this issue..
or Suggest some alternatives
Thanks..
God bless you..