Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

basic website help!

Options
  • 29-12-2010 10:16pm
    #1
    Closed Accounts Posts: 35


    I'm not sure if I've posted this in the right area.... I'm trying to get a contact form so that it emails to me. This is the contact form php:
    <?php
    $email = $_REQUEST ;
    $phone = $_REQUEST ;
    $message = $_REQUEST ;

    mail( "myemail@gmail.com", "GAL Website Enquiry",
    $message, $phone, "From: $email" );
    header( "Location: http://www.greenavenuelandscapes.ie/thankyou.htm&quot; );
    ?>

    The address is www.greenavenuelandscapes.ie/contactus.htm

    It's all in early stages so don't judge too harshly!


Comments

  • Registered Users Posts: 6,510 ✭✭✭daymobrew


    I think that the $phone parameter is your problem - it is being interpreted as the $additional_headers parameter.

    Look at the examples in the mail() docs.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Yeah you should append the phone number onto the message or subject.


  • Closed Accounts Posts: 35 graciek


    Brilliant! Thanks guys. I've taken it out and it works perfectly. I just need to put the phone number in somehow... I'm pretty rusty on this stuff, is there any easy way I can add this in? I was a bit overwhelmed by the code on that link! :)


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    try

    [php]
    <?php
    $email = $_REQUEST ;
    $phone = $_REQUEST ;
    $message = $_REQUEST ;
    $message = $message." \r\nTheir phone number is: ".$phone;

    mail( "myemail@gmail.com", "GAL Website Enquiry",
    $message, $phone, "From: $email" );
    header( "Location: http://www.greenavenuelandscapes.ie/thankyou.htm&quot; );
    ?>
    [/php]


  • Closed Accounts Posts: 35 graciek


    that one doesn't seem to be working :/


  • Advertisement
  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Sorry get rid of the phone again. Just the one you have workign with that extra message part.


  • Moderators, Politics Moderators Posts: 39,853 Mod ✭✭✭✭Seth Brundle


    On a slightly different matter but you should get into the habit when starting off...
    http://www.thesitewizard.com/php/protect-script-from-email-injection.shtml


  • Closed Accounts Posts: 35 graciek


    Thanks a million, that worked perfectly. Although now the send me a copy button doesnt seem to work... I think it did before. I'm half asleep so I may be wrong.... if anyone has any ideas feel free to say!

    Thanks guys! I'll get the anti-spam business up tomorrow.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    graciek wrote: »
    Thanks a million, that worked perfectly. Although now the send me a copy button doesnt seem to work... I think it did before. I'm half asleep so I may be wrong.... if anyone has any ideas feel free to say!

    Thanks guys! I'll get the anti-spam business up tomorrow.
    No probs. Send me a copy prob entails a CC so look at the headers etc. Yeah be sure to do what kbannon says.


Advertisement