logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 07-18-2012, 06:55 PM   #1
euge1089
 
Join Date: Jul 2012
Posts: 2
Default sendresults.php issue

Hello Everyone,
I am new to the this website, but to begin, I have started creating websites a few months ago and have never had a problem with forms until now. The issue is that the form just doesn't send to my email, i have tried troubleshooting and couldn't figure anything out. The sendresults.php still redirects me to my next page but thats about it, it just doesn't email me the form results. Please help!
Thanks,
Eugene

Form Code:
<form id="PurchaseForm" name="PurchaseForm" action="sendresults.php" method="post">
<table width="750" border="1" align="center">
<tr>
<td width="243" class="tablecolor">Full Name</td>
<td width="491"><span id="sprytextfield1">
<input name="text1" type="text" id="text1" size="50" />
<span class="textfieldRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<td class="tablecolor">Desired Date of Birth</td>
<td><span id="spryselect1">
<label for="DOB"></label>
<select name="DOB" id="DOB">
<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>
<span class="selectRequiredMsg">Please select an item.</span></span><span id="spryselect2">
<label for="DOB2"></label>
<select name="DOB2" id="DOB2">
<option value="Jan">Jan</option>
<option value="Feb">Feb</option>
<option value="Mar">Mar</option>
<option value="Apr">Apr</option>
<option value="May">May</option>
<option value="Jun">Jun</option>
<option value="Jul">Jul</option>
<option value="Aug">Aug</option>
<option value="Sep">Sep</option>
<option value="Oct">Oct</option>
<option value="Nov">Nov</option>
<option value="Dec">Dec</option>
</select>
<span class="selectRequiredMsg">Please select an item.</span></span><span id="spryselect3">
<label for="DOB3"></label>
<select name="DOB3" id="DOB3">
<option value="1995">1995</option>
<option value="1994">1994</option>
<option value="1993">1993</option>
<option value="1992">1992</option>
<option value="1991">1991</option>
</select>
<span class="selectRequiredMsg">Please select an item.</span></span></td>
</tr>
<tr>
<td class="tablecolor">ID Choice</td>
<td><span id="spryselect4">
<label for="ID Selection"></label>
<select name="ID Selection" id="ID Selection">
<option value="Boston College">Boston College</option>
<option value="Boston University">Boston University</option>
<option value="Quincy College">Quincy College</option>
<option value="Quinipaic University">Quinipaic University</option>
<option value="Umass Amherst">Umass Amherst</option>
<option value="Fairfield University">Fairfield University</option>
</select>
<span class="selectRequiredMsg">Please select an item.</span></span></td>
</tr>
<tr>
<td class="tablecolor">Shipping Name</td>
<td><span id="sprytextfield2">
<label for="Shipping Name"></label>
<input name="Shipping Name" type="text" id="Shipping Name" size="50" />
<span class="textfieldRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<td class="tablecolor">Delivery Address</td>
<td><span id="sprytextfield3">
<label for="Delivery Address"></label>
<input name="Delivery Address" type="text" id="Delivery Address" size="50" />
<span class="textfieldRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<td class="tablecolor">City</td>
<td><span id="sprytextfield4">
<label for="City"></label>
<input name="City" type="text" id="City" size="50" />
<span class="textfieldRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<td class="tablecolor">State</td>
<td><span id="sprytextfield5">
<label for="State"></label>
<input name="State" type="text" id="State" size="50" />
<span class="textfieldRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<td class="tablecolor">ZIP</td>
<td><span id="sprytextfield6">
<label for="ZIP"></label>
<input name="ZIP" type="text" id="ZIP" size="50" />
<span class="textfieldRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<td class="tablecolor">Additional Info</td>
<td><span id="sprytextarea1">
<label for="Add Info"></label>
<textarea name="Add Info" id="Add Info" cols="50" rows="5"></textarea>
</span></td>
</tr>
<tr>
<td class="tablecolor"><input name="Submit" type="submit" class="tablecolor" id="Submit" value="Submit" /></td>

</tr>
</table>
<p>&nbsp;</p>
</form>

sendresults.php:

<?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Purchase Form';

// Your email address. This is where the form information will be sent.
$emailadd = 'dmattie97@yahoo.com';

// Where to redirect after form is processed.
$url = 'http://www.funidcards.com/upload.php';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>
euge1089 is offline   Reply With Quote
Old 07-19-2012, 02:17 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

save this as a php page ie mailtest.php, go to it on your server and check if you get sent an email (every time its refreshed)
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 07-19-2012, 05:44 PM   #3
euge1089
 
Join Date: Jul 2012
Posts: 2
Default

Thank You so much!
euge1089 is offline   Reply With Quote
Old 07-20-2012, 01:58 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

its just a test to see if the mail() function is working
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:02 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com