Need help with php errors.

Discussion in 'PHP' started by MafiaPenguin, Oct 19, 2009.

  1. #1
    Hi everyone, this is basically my first php script, and Im trying to set up a contact form on my website, so that people can message me with queries, reported bugs etc. However when the submit button is clicked, there are php warnings listed.

    For all i know these could have simple solutions, which is why i need you genius's! :D

    Here are the errors that appear:
    [​IMG]

    And here is the code thats giving the errors: (warnings)

    <?php
      $yourname = $_REQUEST['yourname'] ;
      $youremail = $_REQUEST['youremail'] ;
      $yourmessage = $_REQUEST['yourmessage'] ;
      
      if (!isset($_REQUEST['youremail'])) 
        {
        header( "Location: http://www.mydomain.com/contact.html" );
    	}
      elseif (empty($youremail) || empty($yourmessage))
        {
        header( "Location: http://www.mydomain.com/error.html" );
    	}
      else 
        {	  
      mail( "myemail@mydomain.co.uk", "Feedback Form Results",
        $yourmessage, "From: $yourname <$youremail>" );
      header( "Location: http://www.mydomain.com/thankyou.html" );
        }
    	?>
    Code (markup):
    [​IMG]

    Im guessing you would need more information to help me here, if you do, please ask and i'l provide it

    thanks for your time
     
    Last edited: Oct 19, 2009
    MafiaPenguin, Oct 19, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    NO further info needed. Your host has disabled your mail function by default, and by the looks of it you need to upgrade in order to be able to use it
    The second error is due to the first being output before you redirect
     
    JAY6390, Oct 19, 2009 IP
  3. MafiaPenguin

    MafiaPenguin Guest

    Messages:
    134
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Oh cool thanks,

    Well at the moment I'm using a free hosting site, with no mail system, so i can see why now.

    Is there a way i can bypass this and still have mail sent to me from my website? or do i need to go back with a host that provides an email.



    btw, you do mean my website host, not my email host? (there different for me)
     
    MafiaPenguin, Oct 19, 2009 IP
  4. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I mean the host that is supplying you hosting space to make the php script. Yes you will need to either purchase the mail functionality off your hosting company or get a new one (They're very cheap these days)
     
    JAY6390, Oct 19, 2009 IP
  5. MafiaPenguin

    MafiaPenguin Guest

    Messages:
    134
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ok, im changing hosts (or at least looking around a bit)

    Thanks for your help
     
    MafiaPenguin, Oct 19, 2009 IP