Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

basic website help!

  • 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, Registered Users 2 Posts: 6,680 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Paid Member Posts: 44,263 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

    Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/ .



  • 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, Registered Users 2 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