Posts: 157
Location: Toronto, CANADA
|
Hi all,
I am getting the following message when the 1st if condition is met when passed form at http://students.fasken.com/ipw2007/form-old.html to int_pre.php:
Warning: Cannot modify header information - headers already sent by (output started at C:\WebClients\vhosts\fasken.com\subdomains\student s\httpdocs\ipw2007\int_prep.php:19) in C:\WebClients\vhosts\fasken.com\subdomains\student s\httpdocs\ipw2007\int_prep.php on line 20
This is the code for int_pre.php:
PHP Code:
include("config.php");
$connection=mysql_connect($hostname,$user,$pass)or die ("Failed to connect.");
mysql_select_db($dbname,$connection) or die ("Cannot connect to DB");
$count="
select count(REG_ID) as COUNT
from int_prep2006
";
$result=@mysql_query($count, $connection) or die ("Could not execute query.");
while ($row=mysql_fetch_array($result))
{
$total_reg=$row['COUNT'];
}
if ((!$title)||(!$first_nm)||(!$last_nm)||(!$email)||(!$phone)||(!$school)||(!$year)||(!$session))
{
echo "<html><head><title>Error!</title></head><body bgcolor=\"#ffffff\"><p> </p><p><center><font color=\"#3D007e\" size=4>You have not filled some of the required fields.<br>Click on the \"Back\" button on your browser and fill in the form<b> completely</b>.";
header ( "Location:http://students.fasken.com/ipw2007/index.php");
exit;
}
if ($total_reg >= 45)
{
header ( "Location:http://students.fasken.com/ipw2007/sessionfull.html");
exit;
}
$sql="
insert into int_prep2006
(REG_ID, TITLE, FIRST_NM, LAST_NM, EMAIL, SCHOOL, YEAR, PHONE, SESSION)
values
('', '$title', '$first_nm', '$last_nm', '$email', '$school', '$year', '$phone', '$session')
";
$result=mysql_query($sql, $connection) or die ("Could not insert data into the DB.");
if ($result)
{
header ( "Location:http://students.fasken.com/ipw2007/thanks1.html");
}
All condition work perfectly except for the one that checks for all form feilds to be filled (the 1st "if" condition in the code above). Can someone please tell me why I get this error message?
Thanks
|