PDA

View Full Version : Headers Error - Help



.:Jack120:.2
01-11-2007, 03:10 PM
Well on our Form, the refresh isnt working.
The error is:

Warning: Cannot modify header information - headers already sent by (output started at /home/tropica/public_html/URL TO PAGE/process.php:10) in /home/tropica/public_html/URL TO PAGE/process.php on line 64The code is:

<head>
<link rel="stylesheet" type="text/css" href="../../../pages/css.css">
</head>
<body>
<center>
<table id="table1" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="6">
<img border="0" src="../../../images/pagesleft.gif" width="6" height="22"></td>
<td style="-moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(255, 255, 255); font-size: 11px; font-weight: bold; background-image: url('../../../images/pagesmiddle.gif'); background-repeat: repeat; background-attachment: scroll; background-position: 0% 50%">
<font size="1" color="#000000">Graphics Designer Application Form</font></td>
<td width="6">
<img border="0" src="../../../images/pagesright.gif" width="6" height="22"></td>
</tr>
</table>
</center>
<p>
<?php
include("global.inc.php");
$errors=0;
$error="<font color=\"red\"><strong>The following errors occured while processing your Graphics Designer Application:</strong></font><ul>";
pt_register('POST','fullname');
pt_register('POST','email');
pt_register('POST','tropicaclubusername');
pt_register('POST','tropicaboardsusername');
pt_register('POST','age');
pt_register('POST','programused');
pt_register('POST','transparent');
pt_register('POST','animation');
pt_register('POST','whychoose');
$whychoose=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $whychoose);pt_register('POST','experience');
$experience=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $experience);pt_register('POST','anythingelse');
$anythingelse=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $anythingelse);$example=$HTTP_POST_FILES['example'];
if($fullname=="" || $email=="" || $tropicaboardsusername=="" || $age=="" || $programused=="" || $transparent=="" || $animation=="" || $whychoose=="" || $experience=="" || $anythingelse=="" || $example=="" ){
$errors=1;
$error.="<li><p>You did not enter one or more of the required fields. Please go back and try again.</p>";
}
if(!is_uploaded_file($HTTP_POST_FILES['example']['tmp_name'])){
$error.="<li><p>You did not add a banner made for TropicaRadio</p>";
$errors=1;
}
if($errors==1) echo $error;
else{
$image_part = date("h_i_s")."_".$HTTP_POST_FILES['example']['name'];
$image_list[11] = $image_part;
copy($HTTP_POST_FILES['example']['tmp_name'], "files/".$image_part);
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Full Name: ".$fullname."
Email: ".$email."
TropicaClub Username: ".$tropicaclubusername."
TropicaBoards Username: ".$tropicaboardsusername."
Age: ".$age."
Program Used: ".$programused."
Transparent: ".$transparent."
Animation: ".$animation."
Why we should choose: ".$whychoose."
Experience: ".$experience."
Anything else: ".$anythingelse."
Banner made for TropicaRadio: URL TO FILES/files/".$image_list[11]."
";
$message = stripslashes($message);
mail("[email protected]","".$fullname." (".$tropicaclubusername.") - Graphics Designer",$message,"From: ".$email."");

header("refresh: 0;url=thanks.php");
?><?php
}
?>
<a href="#" onclick="history.go(-1);return false;"><p>Click here to go back and fix these errors.</p></a>
</p>
</body>Can any one see whats wrong? or how to fix it.
Thanks.
+Rep when/if I get my other accout back =]

[Oli]
01-11-2007, 04:06 PM
try adding an @ , that helped with me ;)

find

header("refresh: 0;url=thanks.php");

replace with:

@header("refresh: 0;url=thanks.php");

.:Jack120:.2
01-11-2007, 04:40 PM
;4076605']try adding an @ , that helped with me ;)

find

header("refresh: 0;url=thanks.php");replace with:

@header("refresh: 0;url=thanks.php");
nope, didnt redirect all all :l

RichardKnox
01-11-2007, 04:59 PM
@ just stops error reporting xD

You can't send headers after HTML, so put the header line at the top.

.:Jack120:.2
01-11-2007, 06:10 PM
@ just stops error reporting xD

You can't send headers after HTML, so put the header line at the top.
I added the html into a php echo and works now.
Thanks =]

Want to hide these adverts? Register an account for free!