 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
jazri
Joined: 28 May 2008 Posts: 3
|
Posted: Wed May 28, 2008 1:25 am Why is the script not working? |
|
|
|
I am trying to get this change of address email feedback but once this script pass this file (sendail.php) it just don't work.
P/S - I have changed the email (Your Email) as advised in the script. My server is a Windows server and PHP is running fine. Tested with a sample form.
This is the sendail.php the processing script.
| Code: |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>
<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$membershipno = $_POST['membershipno'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];
$effectday = $_POST['effectday'];
$effectmth = $_POST['effectmth'];
$effectyear = $_POST['effectyear'];
if (eregi('http:', $notes)) {
die ("Sorry, No hyperlinks is allowed in the message column. Close this window and try again! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Error - Please enter a valid e-mail address</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Close this window and try again! ! ");
}
if(empty($visitor) || empty($visitormail) || empty($membershipno) || empty($notes)) {
echo "<h2>Error - please fill in all fields</h2>\n";
die ("Close this window and try again! ! ");
}
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = "$todayis [EST] \n
From: $visitor ($visitormail)\n
Membership number: $membershipno \n
Requesting for: $attn \n
---------------------------------------------------------
New Address: $notes \n
---------------------------------------------------------
Effective Date \n
Effective day : $effectday \n
Effective month: $effectmth \n
Effective year: $effectyear \n
----------------------------------------------------------
For IT Purpose only \n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
mail("YourEmail", $subject, $message, $from);
?>
<p align="center">
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
Requesting For: <?php echo $attn ?>
<br />
New Address:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
Effective Date: <? php echo $effectday ?> <? php echo $effectmth ?> <? php echo $effectyear ?>
<br /><br />
Your IP address: <?php echo $ip ?>
<br /><br />
<a href="thank_you.htm"> Next Page </a>
</p>
</body>
</html>
|
This is the web form where my members will fill in (contact.php)
| Code: |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Change of Address Form </title>
</head>
<body>
<form method="post" action="sendeail.php">
<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br />
Your Membership Number:<br />
<input type="text" name="membershipno" size="35" /><br />
<br />
Request For:<br />
<select name="attn" size="1">
<option value="Change of Address" selected="selected">Change of Address </option>
</select>
<br /><br />
New Address:
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<br />
Effective Date:<br />
<select name="effectday" size="1">
<option selected="selected" value="Day">Day</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select> <select name="effectmth" size="1">
<option selected="selected" value="Month">Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select><select name="effectyear" size="1">
<option selected="selected" value="Year">Year</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
</select><br />
<br />
<input type="submit" value="Submit" />
<br />
</form>
</body>
</html>
|
|
|
thexpgeek

Joined: 13 Dec 2007 Posts: 24
|
Posted: Wed May 28, 2008 10:15 am |
|
|
|
looks like you form in contact.php is posting to the wrong place
| Quote: |
| <form method="post" action="sendeail.php"> |
Tony |
|
jazri
Joined: 28 May 2008 Posts: 3
|
Posted: Wed May 28, 2008 5:34 pm |
|
|
|
| Thanks Tony, but the filename was correct. It's just a typo in my post. If you try changing to different filename it's the same. |
|
thexpgeek

Joined: 13 Dec 2007 Posts: 24
|
Posted: Fri May 30, 2008 4:56 am |
|
|
|
| Quote: |
| Code: |
| Effective Date: <? php echo $effectday ?> <? php echo $effectmth ?> <? php echo $effectyear ?> |
|
shoud be
| Code: |
| Effective Date: <?php echo $effectday ?> <?php echo $effectmth ?> <?php echo $effectyear ?> |
Give that a try
Tony |
|
jazri
Joined: 28 May 2008 Posts: 3
|
Posted: Sun Jun 01, 2008 7:04 pm |
|
|
|
| Thanks Tony. It worked! |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|