Hey. I have been recently messing around with premade Form Emailer script that I have been sprucing up and editing a bit so it works with my site’s order form. It has a few checkboxes that turned up with errors but by adding simple if statements I corrected that problem. However, I am still receiving errors in the script:
Notice: Use of undefined constant HTTP_CLIENT_IP - assumed 'HTTP_CLIENT_IP' in C:Websitesvdospecialtiesform_emailer.php on line 59Notice: Use of undefined constant REMOTE_ADDR - assumed ‘REMOTE_ADDR’ in C:Websitesvdospecialtiesform_emailer.php on line 63
Notice: Undefined index: in C:Websitesvdospecialtiesform_emailer.php on line 91
Notice: Undefined index: in C:Websitesvdospecialtiesform_emailer.php on line 92
Notice: Undefined variable: comments in C:Websitesvdospecialtiesform_emailer.php on line 135
I do not know what causes these problems…the first two errors do not even make sense because I deleted that portion of the script that was made to retreive IP’s because I had no use for it, but for some reason it still returns an error. The other I do not quite know how to fix and I would like any help anyone can offer on this situation.
Here is my form emailer code:
<?php
##################################################
## Email sender by: Steve "Defender" Cunningham ##
##################################################
## ##
## Edit the proper variables to make the script ##
## work on your site. ##
## ##
##################################################
## ##
## If I'm not busy, you can email me at: ##
## [email protected] and I can try to help ##
## you with your problem. ##
## ##
##################################################
## ##
## Note that if the copyright info is deleted, ##
## this script is no longer valid. ##
## ##
##################################################
//Define some variables
$youremail="[email protected]"; // This is the address that the information submitted will be sent to.
$emailsubject="Repair/Mod Order"; // This will the email's subject
// The From field will be be where this email came from.
// Note on the from field. the text after the first " mark, until the < is what appears in "From" in your email program.
// So, you can put anything alpha numeric here. That would be any letters A-Z and a-z, as well as 0-9
$from_who="Repair/Mod Order Form";
$pagetitle="Thank you!"; // Title to be displayed on the sent info page.
// Enter the code that you want to appear before the information submitted.
// Make sure you put a / mark before all double quotation marks or the script won't work.
// the n at the end of the line is to create a new line in the HTML SOURCE. It DOES NOT create a break or new line
// when viewing it on the internet. Put these at the end of each line in the header and footer if you wish.
// They aren't required.
$header = "<!-- Begin Header -->n
<table>n
<tr>n
<td bgcolor="000000"><font color="FFFFFF" size="2" face="verdana">n
<!-- End Header -->n";
// Enter the code you'd like displayed after the information submitted.
// Make sure you put a / mark before all double quotation marks or the script won't work.
// the n at the end of the line is to create a new line in the HTML SOURCE. It DOES NOT create a break or new line
// when viewing it on the internet. Put these at the end of each line in the header and footer if you wish.
// They aren't required.
$footer = "<!-- Begin Footer -->n
</td></tr></table>n
<!-- End Footer -->n";
// This code gets the ip address of the person submiting the form.
// You shouldn't remove it if you want to use this feature.
// If your server uses php version 4.2 or above, you can leave this section alone.
// Otherwise, add 2 slashes (//) to the beginning of the following 4 lines and delete the // in the section below.
$Name = $_POST['Name'];
$Address = $_POST['Address'];
$City = $_POST['City'];
$State = $_POST['State'];
$Zip = $_POST['Zip'];
$Email = $_POST['Email'];
$Phone = $_POST['Phone'];
$Model = $_POST['Model'];
$Serial = $_POST['Serial'];
if($_POST['Repair1']) $Repair1 = $_POST['Repair1'];
if($_POST['Repair0']) $Repair1 = $_POST['Repair0'];
if($_POST['Mod1']) $Repair1 = $_POST['Mod1'];
if($_POST['Mod0']) $Repair1 = $_POST['Mod0'];
if($_POST['Express1']) $Repair1 = $_POST['Express1'];
if($_POST['Express0']) $Repair1 = $_POST['Express0'];
$Repair_Cost = $_POST['Repair_Cost'];
$Mod_Cost = $_POST['Mod_Cost'];
$Shipping_Handling = $_POST['Shipping_Handling'];
$Total_Cost = $_POST['Total_Cost'];
$Payment_Method = $_POST['Payment_Method'];
$Routing_Code = $_POST['Routing_Code'];
$Bank_Account_Number = $_POST['Bank_Account_Number'];
$Check_Number = $_POST['Check_Number'];
$Problem = $_POST['Problem'];
//$firstname = $HTTP_POST_VARS['firstname'];
//$email = $HTTP_POST_VARS['email'];
//$url = $HTTP_POST_VARS['url'];
//$comments = $HTTP_POST_VARS['url'];
// Edit the following lines to customize how the email sent to you will look.
// To add more fields, just copy and paste the line, and edit the info between the " marks.
// The last 2 lines will send the users browser information and their ip number with the mail.
// Just in case. :)
$mailbody="Name:n=================n$Namenn";
$mailbody="Address:n=================n$Addressnn";
$mailbody="City:n=================n$Citynn";
$mailbody="State:n=================n$Statenn";
$mailbody="Zip:n=================n$Zipnn";
$mailbody="Email:n=================n$Emailnn";
$mailbody="Phone:n=================n$Phonenn";
$mailbody="Model:n=================n$Modelnn";
$mailbody="Serial:n=================n$Serialnn";
$mailbody="Repair Yes:n=================n$Repair1nn";
$mailbody="Repair No:n=================n$Repair0nn";
$mailbody="Mod Yes:n=================n$Mod1nn";
$mailbody="Mod No:n=================n$Mod0nn";
$mailbody="Express Yes:n=================n$Express1nn";
$mailbody="Express No:n=================n$Express0nn";
$mailbody="Repair Cost:n=================n$Repair_Costnn";
$mailbody="Mod Cost:n=================n$Mod_Costnn";
$mailbody="Shipping and Handling:n=================n$Shipping_Handlingnn";
$mailbody="Total Cost:n=================n$Total_Costnn";
$mailbody="Payment Method:n=================n$Payment_Methodnn";
$mailbody="Routing Code:n=================n$Routing_Codenn";
$mailbody="Bank Account Number:n=================n$Bank_Account_Numbernn";
$mailbody="Check Number:n=================n$Check_Numbernn";
$mailbody="Problem:n=================n$Problemnn";
mail("$youremail", "$emailsubject", "$mailbody", "From: $from_who"); // Send the email.
$comments = nl2br($comments);
// Page HTML comes next.
?>
<html>
<head>
<title><?php $pagetitle ?></title>
</head>
<body>
<?php print $header;
// A note about the following.
// Each of the printed values here correspond to a field in the form.
// Change this area if you change what fields are in the form.
?>
Submitted information:<br><br>
Name: $Name
<p>
Address: $Address
<p>
City, State, Zip: $City , $State $Zip
<p>
E-Mail: $Email
<p>
Phone: $Phone
<p>
---------------------------------------
<p>
Model: $Model
<p>
Serial #: $Serial
<p>
Repair Yes: $Repair1 Repair No: $Repair0
<p>
Mod Yes: $Mod1 Mod No:$Mod0
<p>
Express Yes: $Express1 Express No: $Express0
<p>
Repair Cost: $Repair_Cost
<p>
Mod Cost: $Mod_Cost
<p>
S&H: $Shipping_Handling
<p>
Total Cost: $Total_Cost
<p>
Payment Method: $Payment_Method
<p>
Routing Code: $Routing_Code
<p>
Bank Account Number: $Bank_Account_Number
<p>
Check Number: $Check_Number
<p>
Problem: $Problem
<?php print $footer; ?>
<!-- DO NOT EDIT BELOW THIS LINE. -->
<!-- DO NOT EDIT BELOW THIS LINE. -->
<?php
// This is a free script, PLEASE leave my copyright notice.
$date=date("Y");
if ($date==2001){
echo "<br>n<font size="1" face="verdana">nThis script is Copyright ©";
echo (date("Y"));
echo " Steven "<a href="mailto:[email protected]">Defender</a>" Cunninghamn";
}
else
{
print "<br>n<font size="1" face="verdana">nThis script is Copyright © 2001-";
print (date("Y"));
print " Steven "<a href="mailto:[email protected]">Defender</a>" Cunninghamn";
}
?>
<!-- DO NOT EDIT THE ABOVE LINES -->
<!-- DO NOT EDIT THE ABOVE LINES -->
</body>
</html>