Jump to content


Photo

PHP autoresponder form won't show "Thank You" string


  • Please log in to reply
2 replies to this topic

#1 antray

antray
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 02 June 2006 - 12:16 PM

I have been using a php form with a built-in autoresponder for three years now and I have been having problems with it on our new server. It sends an email to the user and the sales staff fine, but it doesn't show a "thank you for your request" message once submitted. This message is containted in a "$thanks" variable.

Our old server uses PHP version 4.3.8 and is on a windows NT server.
Our new one is version 4.4.2-1+b1 on Linux.

URL on virtual Apache server: [a href=\"http://gndzero.com/order-test.php\" target=\"_blank\"]http://gndzero.com/order-test.php[/a]

code is below:

<?php

// MODIFY THE FOLLOWING SECTION

// your name
$recipientname = "Sales Staff";


// your email
$recipientemail = "elmore@gndzero.com, sales@gndzero.com";

// subject of the email sent to you
$subject = "Online-Form Response for $recipientname";

// send an autoresponse to the user?
$autoresponse = "yes";

// subject of autoresponse
$autosubject = "Thank you for your Order!";

$autocontact = "$Name";
// autoresponse message
$automessage = "Dear $Name,


This is an automatic 'thank you' response to your interest in Ground Zero.  On behalf of the Groundzero.com staff, I'd like to take this opportunity to welcome you to save on all your static control needs now, and in the future.  It is my sincere hope that we will be able to build a lasting business relationship that can help your business profit by saving money and time with Ground Zero Quality ESD Control Products & Services. 

Give us a call at 1-877-GND-ZERO (463-9376) if you have any questions.


The following quote information was sent to our sales staff:  $quote.


Sincerely,


Anthony R. Murfin  
Vice President Sales 
Ground Zero Electrostatics."
;


// thankyou displayed after the user clicks "submit"
$thanks = "<br><br><font size=2>Thank you for your interest in Ground Zero. Our sales staff will review your requirements and send you a quote as soon as possible.
<a href = order.php><br><--Go back to Order Page</a></font>
";

// END OF NECESSARY MODIFICATIONS

?>

<?php
if($submitform) {

$name = $HTTP_POST_VARS['name'];
$email = $HTTP_POST_VARS['email'];
$comments = $HTTP_POST_VARS['quote'];

// check required fields
$dcheck = explode(",",$require);
while(list($check) = each($dcheck)) {
if(!$$dcheck[$check]) {
$error .= "Missing $dcheck[$check]<br>";
}
}

// check email address
if ((!ereg(".+\@.+\..+", $Email)) || (!ereg("^[a-zA-Z0-9_@.-]+$", $Email))){
$error .= "Invalid email address<br>";}

// display errors
if($error) {
?>

<b>Error</b><br>
<?php echo $error; ?><br>
<a href="#" onClick="history.go(-1)">try again</a>


<?php
}
else 
{

$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR;

// format message
$message = "Online-Form Response for $recipientname:

Name: $Name
Email: $Email
Company Name: $company
Phone Number: $phone
Fax Number: $fax
Address: $address
Address2: $address2
City: $city
State/Providence: $state
Zip/Postal Code: $zip

Country: $country

Quote: $quote

How did you hear about us?:  $customer, $advertisment, $internet

Which search engine?:  $google, $yahoo, $altavista, $lycos, $alltheweb, $teoma
-----------------------------

Browser: $browser
User IP: $ip";

// send mail and print success message
$hurrah = mail($toemail,"$subject","$message","From: $Name <$Email>");
if($hurrah) {
if($autoresponse == "yes") {
$autosubject = stripslashes($autosubject);
$autocontact = stripslashes ($Name);
$automessage = stripslashes($automessage);
mail($Email,"$autosubject", "$autocontact","$automessage","From: $recipientname <$recipientemail>");
}
echo "$thanks"; <--This should show, but it doesn't
}
}
} 
else {
?>


<form name="contactform" action="<?php echo $PHP_SELF; ?>" method="post">


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 June 2006 - 12:25 PM


echo thanks know!

echo $thanks;

<?php

// MODIFY THE FOLLOWING SECTION

// your name
$recipientname = "Sales Staff";
// your email
$recipientemail = "elmore@gndzero.com, sales@gndzero.com";

// subject of the email sent to you
$subject = "Online-Form Response for $recipientname";

// send an autoresponse to the user?
$autoresponse = "yes";

// subject of autoresponse
$autosubject = "Thank you for your Order!";

$autocontact = "$Name";
// autoresponse message
$automessage = "Dear $Name,
This is an automatic 'thank you' response to your interest in Ground Zero.  On behalf of the Groundzero.com staff, I'd like to take this opportunity to welcome you to save on all your static control needs now, and in the future.  It is my sincere hope that we will be able to build a lasting business relationship that can help your business profit by saving money and time with Ground Zero Quality ESD Control Products & Services. 

Give us a call at 1-877-GND-ZERO (463-9376) if you have any questions.
The following quote information was sent to our sales staff:  $quote.
Sincerely,
Anthony R. Murfin  
Vice President Sales 
Ground Zero Electrostatics."
;
// thankyou displayed after the user clicks "submit"
$thanks ="<br><br><font size=2>Thank you for your interest in Ground Zero. Our sales staff will review your requirements and send you a quote as soon as possible.
<a href = order.php><br><--Go back to Order Page</a></font>
";

// END OF NECESSARY MODIFICATIONS

?>

<?php
if($submitform) {

$name = $HTTP_POST_VARS['name'];
$email = $HTTP_POST_VARS['email'];
$comments = $HTTP_POST_VARS['quote'];

// check required fields
$dcheck = explode(",",$require);
while(list($check) = each($dcheck)) {
if(!$$dcheck[$check]) {
$error .= "Missing $dcheck[$check]<br>";
}
}

// check email address
if ((!ereg(".+\@.+\..+", $Email)) || (!ereg("^[a-zA-Z0-9_@.-]+$", $Email))){
$error .= "Invalid email address<br>";}

// display errors
if($error) {
?>

<b>Error</b><br>
<?php echo $error; ?><br>
<a href="#" onClick="history.go(-1)">try again</a>
<?php
}
else 
{

$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR;

// format message
$message = "Online-Form Response for $recipientname:

Name: $Name
Email: $Email
Company Name: $company
Phone Number: $phone
Fax Number: $fax
Address: $address
Address2: $address2
City: $city
State/Providence: $state
Zip/Postal Code: $zip

Country: $country

Quote: $quote

How did you hear about us?:  $customer, $advertisment, $internet

Which search engine?:  $google, $yahoo, $altavista, $lycos, $alltheweb, $teoma
-----------------------------

Browser: $browser
User IP: $ip";

// send mail and print success message
$hurrah = mail($toemail,"$subject","$message","From: $Name <$Email>");
if($hurrah) {
if($autoresponse == "yes") {
$autosubject = stripslashes($autosubject);
$autocontact = stripslashes ($Name);
$automessage = stripslashes($automessage);
mail($Email,"$autosubject", "$autocontact","$automessage","From: $recipientname <$recipientemail>");
}
echo $thanks;
}
}
} 
else {
?>
<form name="contactform" action="<?php echo $PHP_SELF; ?>" method="post">


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 antray

antray
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 02 June 2006 - 01:22 PM

It's the virutal server thats having the problem. I just uploaded it to my domain and it works perfectly.

When a php form is on a virtual server, does that effect how it works? It points to "http://" not "www" until I switch DNS over to our new servers permanently..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users