Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old December 31st, 2008, 12:58 PM   #1
New Member
 

Join Date: Dec 2008
Location: Leeds
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Flyingfoxes is on a distinguished road
Help - PHP email form help needed

I am new (very) new to PHP and need some help in setting up a simple form to email script to catch data entered into a pre made form. the data i need to catch is 'Name', 'Number', 'EMail' and 'Message'.

I have looked at the following script (which works in it's present form for one of my requirements) but everytime I expand the Mail '$_Request [Name]' etc the email is not sent to my inbox. I host with Streamline.net so i have to have the 'ini and '-froot' code inserted.

<?php
ini_set('sendmail_from', 'root@myemailaddress.co.uk');
mail("Contact Form results", "Name: $_REQUEST[Name]", "From: $_REQUEST[email]", "root@myemailaddress.co.uk", "-froot@myemailaddress.co.uk");header( "Location: http://www.myemailaddress.co.uk/thankyou.html" );?>

Please can anyone help me out with what I need to input to get an email with the four categories above (name, Email, Number and Message) returned?

Thanks
Flyingfoxes
Flyingfoxes is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old January 3rd, 2009, 07:45 AM   #2
New Member
 

Join Date: Dec 2008
Location: Leeds
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Flyingfoxes is on a distinguished road
Re: Help - PHP email form help needed

After reviewing the code i have solved the problem.

You can use the following code for streamline.net hosting to send form data using the sendmail function (to email). This should work for any form as long as the field IDs are changed below, email addresses added and you set up a thankyou.html page.

<?php
ini_set('sendmail_from', 'root@youremailladdress.co.uk');
$name = $_REQUEST["Name"];
$number = $_REQUEST["Number"];
$email = $_REQUEST ["EMail"];
$message = $_REQUEST ["Message"];
$name = stripslashes($name);
$number = stripslashes($number);
$email = stripslashes ($email);
$message = stripslashes ($message);
mail('root@youremailaddress.co.uk', "Request from: $name", "<b>Name:</b>". $name."\n". "\n". "<b>Number:</b>". $number."\n". "<b>Email:</b>". $email."\n"."\n"."<b>Message:</b>"."\n". $message, "From: $email", "-froot@youremailaddress.co.uk");
header( "Location: http://www.youremailaddress.co.uk/thankyou.html" );?>
Flyingfoxes is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form To Email with streamline.net no email recieved! slinkydonkey PHP 18 April 29th, 2009 05:57 AM
email script file needed edufalcao PHP 1 August 23rd, 2008 09:34 AM
PHP email form not sending email Kurt PHP 1 October 12th, 2007 12:26 AM
Form submits to email via php, but email is blank!!?? DH1234 PHP 2 June 18th, 2007 06:42 AM
Form to Email daveycee HTML, XHTML and CSS 3 March 16th, 2006 05:25 PM


Search Engine Optimization by vBSEO 3.2.0 RC8