paulgain Posted September 9, 2009 Share Posted September 9, 2009 Hi Everyone, I have wrote a Flex website and on the site I have a "Contact us" page. On this page is a form (no HTML) for the user to fill in their details, I also validate their details before sending them off. I do not want to use a HTML form as it's ugly. I am using a HTTP POST to send the users details to my PHP Script for processing. I want the script to simply pull out the users details and then email me. I have seen plenty of examples of using a HTML form and corresponding mail script, but like i've already said I don't want to use a HTML form. I have set up an Apache web server and configured PHP and it all works as expected when I call phpInfo(). I need help with the script as I have no experience in PHP whatsoever. I would like to do the following: (1) Pullout the users details which are "firstname", "lastname" "contactnumber" "emailaddress" and "message". (2) Email me with those details, that's it. I would like a response to indicate success/failure but not as a HTML page. Cheers Paul Link to comment https://forums.phpfreaks.com/topic/173647-email-script/ Share on other sites More sharing options...
Garethp Posted September 9, 2009 Share Posted September 9, 2009 if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "[email protected]", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } It's pretty straightforward, you should be able to figure it out from there Link to comment https://forums.phpfreaks.com/topic/173647-email-script/#findComment-915326 Share on other sites More sharing options...
paulgain Posted September 9, 2009 Author Share Posted September 9, 2009 Thanks for the quick reply, If I call the script from my dev environment where does echo echo out to, if you see what I mean. Regards Paaul Link to comment https://forums.phpfreaks.com/topic/173647-email-script/#findComment-915337 Share on other sites More sharing options...
Garethp Posted September 10, 2009 Share Posted September 10, 2009 Echo means display. So if you access it from a browser, it will show it. If you call it with a HTTPRequest, that text will be the response. Get it? Link to comment https://forums.phpfreaks.com/topic/173647-email-script/#findComment-915895 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.