I wrote this code and worked perfectly on my localhost but after uploading it I get an error below is the code :
<?php
require ('config.php');
$dblink = new PDO("mysql:host=$host;dbname=$db",$user,$pass);
session_start();
$user = $_POST["user"];
$pass = md5($_POST["pass"]);
$mysql_login = "SELECT * FROM admins WHERE username='$user' AND password='$pass'";
$query_login = $dblink->query($mysql_login) or die("failed!");
$total = $query_login->rowCount();
if($total==1){
$_SESSION["loggedIn"] = true;
header("Location:admin.php");
}else{
header("Location:admin.php");
}
?>
And Here is the error
Warning: Cannot modify header information - headers already sent by (output started at /home/voiceiq/public_html/config.php:8) in /home/voiceiq/public_html/login.php on line 12
And as I told you in my localhost "Xampp Server" it's working perfectly but after uploading the warning stills show.
Please any help??