Current location: Hot Scripts Forums » Programming Languages » PHP » Won't autorespond to simple php form


Won't autorespond to simple php form

Reply
  #1 (permalink)  
Old 04-28-05, 06:29 AM
Pixelpyro Pixelpyro is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Won't autorespond to simple php form

Hi

I have a very simple form that takes the values forom input fields and sends them to an email address - this functions fine - however, I want to send out an autoresponder when an email is recieved to the email address provided - unfortunetally this doesn't seem to happen. The auto responder works when emailed directly but not on the form email.

This is the script at the top of the page.

PHP Code:



<?php
if ($_POST) {
if (
get_magic_quotes_gpc()) {
foreach (
$_POST as $key => $value) {
$temp stripslashes($value);
$_POST[$key] = $temp;
}
}
$to 'register@mydomain.com';
$subject 'Gallery signup';
// message goes here
$message "Email Address: " $_POST['email'] . "\n";
$message .= "Mobile Number: " $_POST['mobile'] . "\n";
$message .= "Newsletter: " $_POST['newsletter'] . "\n";

*

// headers go here
$headers "From: " $_POST['email'] . "\n";
$headers .= "Content-type: text/plain; charset=UTF-8";

*

$sent mail($to$subject$message$headers);
}
?>
When the email comes through the body is laid out thus:

Email Address: my@otherdomain.com
Mobile Number: 1234567890
Newsletter: Yes!!

and the From: field in the email would be me@otherdomain.com

I think it's an issue with how it recieves the from email address but not sure.

Any help would be great. Thanks
Reply With Quote
  #2 (permalink)  
Old 04-28-05, 06:49 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
just add an autoresponder in the code after the $sent code...

PHP Code:

$autorespond mail($_POST['email'], "Auto Respond""Message Here""From: Admin<admin@site.com>"); 

__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.

Last edited by FiRe; 04-28-05 at 06:54 AM.
Reply With Quote
  #3 (permalink)  
Old 04-28-05, 07:34 AM
Pixelpyro Pixelpyro is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
You are a genius. why didn't I think of that - works like a charm.

Thanks

P.S. seems the original problem was with the autoresponder after all that anyway - permissions or something (I didn't set it up, client did)

Thanks again..
Reply With Quote
  #4 (permalink)  
Old 04-28-05, 10:39 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
lol no probs
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
Reply

Bookmarks


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

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
Form Submission, PHP Coding Problem kibby67 PHP 3 12-02-04 01:13 PM
trying to create my first simple (?) php script, need guidance HotShotPhoto PHP 1 09-06-04 08:12 PM
saving data with PHP form sXenoGJ PHP 4 04-30-04 11:25 PM
PHP Triad/Upload form eddyvlad PHP 6 10-06-03 11:17 PM


All times are GMT -5. The time now is 06:42 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.