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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

basic website help!

  • 29-12-2010 9: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,571 ✭✭✭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 Posts: 41,234 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, 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