SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    white screen of death on simple form

    Hi.

    I'm creating a simple email form on a local development environment.
    I'm testing it both locally and on a hostgator shared host.

    Upon submitting the form, I'm getting the white screen. This happens on both environments

    After some googling, I came across advice to turn on error reporting, either in the file or in php.ini.
    So locally in my php file that processes the form,
    I have pasted these lines:
    Code:
    ini_set('display_errors', 1); 
     error_reporting(E_ALL);
    I have uncommented this line from my php.ini, before restarting apache:
    Code:
    error_reporting = E_ALL & ~E_NOTICE
    Unfortunatly, this makes no difference. I'm still getting the white screen with no errors being reported.

    How can I further diagnose the problem?
    What is likely to be going wrong?

    Here is a paste of my form processing code:

    PHP Code:
    <?php

    ini_set
    ('display_errors'1); 
     
    error_reporting(E_ALL);


    // Mail header removal
    function remove_headers($string
    $headers = array( "/to\:/i""/from\:/i""/bcc\:/i""/cc\:/i"
                
    "/Content\-Transfer\-Encoding\:/i"
                
    "/Content\-Type\:/i""/Mime\-Version\:/i" ); 
      
    $string preg_replace($headers''$string); return strip_tags($string);
    }

    $name remove_headers($_POST['name']);
    $email remove_headers($_POST['email']);
    $subject remove_headers($_POST['subject']);
    $message remove_headers($_POST['message']);

    // Build the email (replace the address in the $to section with your own)
    $to "me@example.com";
    $email "New message: $subject";
    $message "$email said: $message";
    $headers "From: $email";

    // Send the mail using PHPs mail() function
    mail($to$subject$message$headers);

    ?>
    Last edited by ScallioXTX; Jun 26, 2010 at 09:37. Reason: edited personal details out

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,014
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)
    Have you checked the error logs?

    If you try
    PHP Code:
    // Send the mail using PHPs mail() function
    if ( mail($to$subject$message$headers) )
    {
    echo 
    'Mail Successful';
    }
    else
    {
    echo 
    'Mail Failed';
    }
    ?> 
    Do you see mail Success or Fail or neither?


Tags for this Thread

Bookmarks

Posting Permissions

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