Results 1 to 5 of 5
  1. #1

    Default Headers Error - Help

    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 64
    The code is:
    PHP Code:
    <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 =]
    Last edited by .:Jack120:.2; 01-11-2007 at 03:12 PM.

  2. #2
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default

    try adding an @ , that helped with me

    find
    PHP Code:
    header("refresh: 0;url=thanks.php"); 
    replace with:
    PHP Code:
    @header("refresh: 0;url=thanks.php"); 

  3. #3

    Default

    Quote Originally Posted by [oli] View Post
    try adding an @ , that helped with me

    find
    PHP Code:
    header("refresh: 0;url=thanks.php"); 
    replace with:
    PHP Code:
    @header("refresh: 0;url=thanks.php"); 
    nope, didnt redirect all all

  4. #4
    Join Date
    Jul 2007
    Location
    Scotland
    Posts
    529
    Tokens
    0

    Default

    @ just stops error reporting

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

  5. #5

    Default

    Quote Originally Posted by RichardKnox View Post
    @ just stops error reporting

    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 =]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •