Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 01-29-2007, 10:32 AM Troubleshooting help
Daman's Avatar
Extreme Talker

Posts: 157
Location: Toronto, CANADA
Trades: 0
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>&nbsp;</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
Daman is offline
Reply With Quote
View Public Profile Visit Daman's homepage!
 
 
Register now for full access!
Old 01-29-2007, 10:58 AM Re: Troubleshooting help
metho's Avatar
Ultra Talker

Posts: 481
Location: Gold Coast - Brisbane QLD, Australia
Trades: 0
You cant output html to the browser and expect header() to work. Delete the echo line and try it out.
__________________
I do
Please login or register to view this content. Registration is FREE
based.
Spend a lot of time in
Please login or register to view this content. Registration is FREE
.
And
Please login or register to view this content. Registration is FREE
chews up the rest.

Last edited by metho; 01-29-2007 at 11:00 AM.. Reason: oops
metho is offline
Reply With Quote
View Public Profile Visit metho's homepage!
 
Old 01-29-2007, 11:12 AM Re: Troubleshooting help
Daman's Avatar
Extreme Talker

Posts: 157
Location: Toronto, CANADA
Trades: 0
Thanks metho, I realized that I didnt need the header either and have removed both.

Daman is offline
Reply With Quote
View Public Profile Visit Daman's homepage!
 
Reply     « Reply to Troubleshooting help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11982 seconds with 12 queries