Header Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Vicious
Forum Contributor
Posts: 105
Joined: Fri Jun 20, 2003 12:40 pm

Header Error

Post by Vicious »

hey been getting this erro just trying to setup a simple form mail function. Not very good in php but i get this error

Warning: Cannot add header information - headers already sent by (output started at /home/httpd/vhosts/team101.net/httpdocs/DesertCombatTournament/form.php:8) in /home/httpd/vhosts/team101.net/httpdocs/DesertCombatTournament/form.php on line 32

the form code is I dont think u need the forms please post if needed.

Code: Select all

<?

//Declare the variables
$recipient = "Vicious@team101.net";
$subject = "Entry To Desert Combat Tournament";
$message = "Entry To Desert Combat Tournament
Info:
$recipient,$subject,$message,$email,$tag,$leader,$website,$server";
$subject=$_POST['subject'];

//Contents of form
$name=$_POST['teamname'];
$email=$_POST['email'];
$comments=$_POST['comments'];
$tag=$_POST['tag'];
$leader=$_POST['leader'];
$website=$_POST['website'];
$server=$_POST['server'];

//mail() function sends the mail
mail($recipient,$subject,$message); 

?>
<?
header ("http://www.team101.net/DesertCombatTournament/success.php");
?>
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

Post by SBukoski »

Looks like you may have some white space before the opening <? tag. If so, remove this. No information can be sent prior to header information. White space is considered information.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

What's on lines 1-8 of form.php?

Mac
Post Reply