RobScotland Posted May 16, 2007 Share Posted May 16, 2007 Hello to you all....If someone could help me with this I would be most grateful I have looked through the forum and to be honest I dont know what Im looking at..so sorry if this topic has been covered. I have a small website that I want to put contact form on. I was given a simple php script by my webspace provider...It sends an emal address and a message the user submits...which is fine....but i want to add more....I have tackled the HTML side of things ok.. How can I expand on this even if I knew how to add one more item that would be great help. I have tred many different things and I get nothing.. This is the script provided to me... <?php mail("enquiries@themcdonaldguesthouse.co.uk", "Feedback Form results", $_REQUEST[message], "From: $_REQUEST", "-f".$_REQUEST); header( "Location: http://www.themcdonaldguesthouse.co.uk/thankyou.html" ); ?> Thanks for any help in advance.....Rob Quote Link to comment https://forums.phpfreaks.com/topic/51755-solved-newbie-help-with-form-mail/ Share on other sites More sharing options...
MadTechie Posted May 17, 2007 Share Posted May 17, 2007 Try this form.html Code: <HTML> <head> <title> Form </title> </head> <body> <form action="mail.php" method="POST"> <input name="name"> <br><input name="email"> <br><input name="phone"> <br><input type="submit" value="Send!"> </form> </body> </HTML> mail.php <?php $email = "your@email.adress"; $subject = "Contact Form"; $message = "Name: ".$_POST['name']; $message .= "\nEmail Adress: ".$_POST['email']; $message .= "\nTelephone: ".$_POST['phone']; $message = addslashes($message); mail($email, $subject, $message); echo("Thankyou for filling out the Form!"); ?> on a side note, in your code replace $_REQUEST[message] with {$_REQUEST['message']} and $_REQUEST with {$_REQUEST['email']} Quote Link to comment https://forums.phpfreaks.com/topic/51755-solved-newbie-help-with-form-mail/#findComment-254970 Share on other sites More sharing options...
RobScotland Posted May 17, 2007 Author Share Posted May 17, 2007 Hi Thank You very much, that did the trick....anytime your in Scotland a beer awaits you... Quote Link to comment https://forums.phpfreaks.com/topic/51755-solved-newbie-help-with-form-mail/#findComment-254986 Share on other sites More sharing options...
MadTechie Posted May 17, 2007 Share Posted May 17, 2007 lol WooHoo can you please click solved (bottom left) Quote Link to comment https://forums.phpfreaks.com/topic/51755-solved-newbie-help-with-form-mail/#findComment-255151 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.