Hello,
our web host switched us to cPanel and now all of our logins on our website are not working at all here is the error message we get.
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /homedirs/sonotek/public_html/sono-tek.com/pdf_download/pdflogin.php:2) in /homedirs/sonotek/public_html/sono-tek.com/pdf_download/pdflogin.php on line 3
I am using session_start(); at the beginning of each script here is a sample:
<?php
session_start();
//open the database
include("../forms/open_config.php");
if(isset($_POST['submit'])) {
//select the username and password from the database
$selus = "SELECT user, pass FROM pdf_dload_login WHERE user = '" . $_POST['usname'] . "'";
//pull and store the username and password from the database
$logincheck = mysql_query($selus);
$logincheck = mysql_fetch_assoc($logincheck);
//assign the username and password into an array for validation the redirect to page
$loginpw = $logincheck['pass'];
$loginus = $logincheck['user'];
//validate the login store values into the error varibles or redirect to page
if($usname == $loginus) {
if($pwname == $loginpw) {
$dropbox = $loginpw;
$_SESSION['dropbox'] = $loginpw;
header("Location:http://www.sono-tek.com/pdf_download/progress.php");
exit();
}
else {
$pwerror = "Invalid Password";
}
} else {
$userror = "Invalid Username";
}
}
?>
I know our database is working because there are certain pages that pull from it and they all view correctly. But we have customers who log in to download product lit and no one can access it. Thanks for your help.
Antoni