Site works on local box but not on host
Posted: Wed Nov 16, 2005 6:26 am
Hi,
I am new to programmimg in php and I need help with the following. the whole site works on my local box
but when I upload the site to the host ( Vodahost) the login page does not want to work. It gives the error
Warning: Cannot modify header information - headers already sent by (output started at /home/creditb/public_html/login.php:13) in /home/creditb/public_html/login.php on line 69.
The host is running php version 4.4.1.
My code looks like this:
Any help would be greatley appreciated
I am new to programmimg in php and I need help with the following. the whole site works on my local box
but when I upload the site to the host ( Vodahost) the login page does not want to work. It gives the error
Warning: Cannot modify header information - headers already sent by (output started at /home/creditb/public_html/login.php:13) in /home/creditb/public_html/login.php on line 69.
The host is running php version 4.4.1.
My code looks like this:
Any help would be greatley appreciated
Code: Select all
<?php
include "./common/common.php";
require "./functions/func.inc";
$sqlcheck="SELECT * FROM tblcheck";
$result2=mysql_query($sqlcheck,$link);
$row = mysql_fetch_assoc($result2);
If($row['Paid']==1 OR chdate(mktime(0,0,0,date("m"),date("j"),date("Y")))<=30) {
?>
<html>
<head>
<style><!--
p { color:rgb(0,0,0); font-family:Arial;}
h1 { color:rgb(128,64,0); font-size:12pt; font-family:Arial;}
h2 { color:rgb(64,128,128); font-size:12pt; font-family:Arial;}
p.namo-list { color:rgb(128,0,0); font-size:12pt; font-family:Arial;}
p.namo-sublist { color:rgb(48,114,89); font-size:10pt; font-family:Arial;}
--></style>
<title>Username :</title>
<meta name="generator" content="Namo WebEditor v4.0">
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" style="font-family:Arial,sans-serif;">
<p> </p>
<caption align=center><h3 align="center">Please enter a username</h3></caption>
<form name=login action="<?php $_SERVER['PHP_SELF']?>" method=post>
<table width=100 align=center>
<tr>
<td>Username : </td>
<td><input type=text name=username></td>
<td></td>
</tr>
<tr>
<td>Password : </td>
<td><input type=password name=password></td>
<td></td>
</tr>
<tr>
<td>
<td align=right>
<p><input type="submit" name="Submit" value="Login" align=right></p>
<td></td>
</table>
</form>
</body>
</html>
<?php
require("./common/common.php");
if(isset($Submit)){
$username = $_POST["username"];
$password = sha1($_POST["password"]);
$sql="SELECT username, password FROM tblusers WHERE username='$username' AND password ='$password'";
$result=mysql_query($sql,$link);
if (mysql_fetch_row($result)){
session_start();
header("Cache-control: private");
$_SESSION["username"] = $username;
header("Location: ./authenticate.htm");
}else{
header("Location: ./login.php");
}
}
}
else{
echo "You have not paid for the design of this website";
echo chdate(mktime(0,0,0,11,14,2005));
}
?>