Jump to content

Signature in PHP contact form!


Recommended Posts

:-\

 

I am having a nightmare trying to add a signature to a php form. What I want to do is to send an autoresponder to the user (with a simple thank you) but I want to include html within the php form processor page. Example below.

 

<?php

$adminaddress = "name@company.com"; 
$siteaddress ="http://www.yoursite.com"; 
$sitename = "COMPANY"; 

$date = date("m/d/Y H:i:s");


$action = $HTTP_POST_VARS['action'] ;
$thename = $HTTP_POST_VARS['thename'] ;
$email = $HTTP_POST_VARS['email'] ;
$phone = $HTTP_POST_VARS['phone'] ;
$fax = $HTTP_POST_VARS['fax'] ;
$comments = $HTTP_POST_VARS['comments'] ;


if ($action != ""){

mail ("$adminaddress","Mail from $sitename",
"A visitor has left the following information\n
Name: $thename 
Email: $email\n
Phone: $phone\n
Fax: $fax\n
Comments: $comments\n

        Logged Info :
------------------------------

Date/Time:  $date","FROM:$adminaddress" ) ; 




mail ("$email","Thank You for visiting $sitename", 
"Hi $thename,\n
Thank you for contacting $sitename!\n Your message was received.
Have A Great Day,
Sincerely, $sitename
$siteaddress","FROM:$adminaddress") ; 


$sendresult = "Thank you. You will receive a confirmation email shortly.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo $send_answer;
} 


?>

 

 

I need to add the signature here;

 

   mail ("$email","Thank You for visiting $sitename", 
   "Hi $thename,\n
   Thank you for contacting $sitename!\n Your message was received.
   Have A Great Day,
   Sincerely, $sitename
   $siteaddress","FROM:$adminaddress") ;

 

I can add line by line text using )/n) I know but I want to add formatted html as a signature to the users email. I have tried to find a solution online, like using echo and some other ideas but none of them seemed to work. I have a feeling it is something to do with the fact that it is within the (mail ("$email",).

 

I am in no way a seasoned PHP developer! obviously and I am using a form created in flash, and yes the form itself works fine as it is easy for me to make the actual form work.

 

Any help you can give me would be very welcome!

 

 

Alan

Link to comment
Share on other sites

 

It's actually a good thing that you can not get this to work.

 

Automatically sending an email to any arbitrary email address that gets entered in a form on the Internet is a bad idea. This will quickly get your mail server banned by the major ISP's and put onto the spam databases because every bot script that submits an email address to your form processing code will cause your mail server to send an email out to the entered address.

 

The visitor is already on your web site with their browser open,  just display your thank you message in the browser.

 

An autoresponder email, when one mail server sends to another, makes sense because there is a high likely hood that the sender actually sent that email and he does not mind getting an autoresponse email back. This is not the case when the source of the email address that you are sending to is a field in a form.

Link to comment
Share on other sites

Considering that they fill out this form in flash, are you suggesting that I just send them to a thank you with a signature built into flash ? that way it all stays in flash?

 

When you submit in flash a message already comes up with 'thank you' my client wanted a signature/autoresponder sent as well?

 

 

Alan

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.