SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Receiving information form php contact form

    I can't seem to receive the information from my PHP form. I am new to writing forms so please forgive me if this is a basic question.

    Here is my code:

    Code:
    <html>
    <head>
    <title>Welcome 2 Village Properties Teacher Fund </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    body {
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    	background-color: #EAECD7;
    }
    .style1 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 14px;
    	font-weight: bold;
    	color: #989933;
    }
    .style2 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 11px;
    	line-height: 20px;
    	color: #000000;
    }
    .style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 20px; color: #990000; }
    
    -->
    
    </style>
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    	<table width="1003" cellspacing="0" cellpadding="0">
    		<tr>
    			<td valign="top" background="images/index_02.gif">
    				<table width="100&#37;" cellspacing="0" cellpadding="0">
    					<tr>
    						<td height="40" colspan="3">&nbsp;</td>
    					</tr>
    					<tr>
    						<td colspan="3"><table width="100%" cellspacing="0" cellpadding="0">
    							<tr>
    								<td width="72%" height="103" align="right" valign="bottom">
    									<table width="87%" cellspacing="0" cellpadding="0" >
    										<tr>
    											<td width="5%">&nbsp;</td>
    											<td width="77%">
    												<a href="http://www.villagesite.com"><img src="images/index_06.gif" alt="" width="273" height="58" border="0"></a>
    											</td>
    											<td width="18%">&nbsp;</td>
    										</tr>
    										<tr>
    											<td width="5%" height="39">&nbsp;</td>
    											<td width="77%" height="39">
    												<img src="images/index_081.gif" width="491" height="21" alt="" />
    											</td>
    											<td width="18%" height="39" valign="bottom">
    												<a href="http://www.teachersfund.org/">
    												<img src="images/index_return.gif" alt="" width="110" height="21" border="0" />
    												</a>
    											</td>
    										</tr>
    									</table>
    								</td>
    								<td width="28%" height="103">
    									<img src="images/teachers_fund.gif" width="138" height="92" hspace="5" vspace="3" />
    								</td>
    							</tr>
    							<tr>
    								<td height="19" colspan="2">
    									<table width="82%" align="center" cellpadding="0" cellspacing="0">
    										<tr >
    											<td>
    												<table width="755" class="border" align="center" cellpadding="0" bgcolor="#F4F5EB">
    													<tbody>
    														<tr>
    															<td vAlign="top" >
    																<div align="center">
    																	<table cellSpacing="6" cellPadding="2" width="98%" border="0">
    																		<tbody>
    																			<tr >
    																				<td colspan="2">
    																					<div align="center" class="style1">
    																						<font face="Arial, Helvetica, sans-serif" color="#990000">
    																						<strong>HOW THE PROGRAM WORKS</strong>
    																						</font>
    																					</div>
    																				</td>
    																			</tr>
    																			<tr >
    																				<td width="50%" valign="top" >
    																					<p>
    																					<span class="style2">Please click on the link listed below and fill out the simple grant request. No amount is too small. Please make sure to fill out the request in its entirety and include your personal phone number and personal email so that we may get in touch with you if necessary. All information is kept confidential and will only be used in an effort to contact you in regards to your request. We have found it difficult to notify teachers through the schools by phone or email due to filters or blocks. 
    																					<br /><br />
    																					Applications may be submitted September 1st - April 30th to be considered for the current school year. Applications received after April 30th will be considered for the next school year and will be reviewed in September.
    																					</span>
    																					</p>
    																					<p>
    																					<span class="style2">The Teacher's Fund judges committee meets within the first two weeks of each month to review the previous month's applications.</span>
    																					</p>
    																					<p class="style2">Requests must be received by the last day of the month in order to be considered for the upcoming month's donations. Requests received after the last day of the month will be considered the following month. For example, if you submit a request on October 31st, your request will be reviewed in November.</p>
    																				</td>
    																				<td valign="top" width="50%">
    																					<p class="style5">Notification letters will be <b>EMAILED</b> to all applicants by the end of the month. It is <b>IMPERATIVE THAT YOU PROVIDE YOUR HOME EMAIL ADDRESS</b>, as many of the school's filters will not allow the notification letters through. 
    																					</p>
    																					<p class="style2">Once you receive notification, simply purchase the items you requested and mail the original receipts, along with your notification letter, to:</p>
    																					<p class="style2">Village Properties Teacher's Fund
    																					<br />c/o Donna Jordan
    																					<br />1250 Coast Village Road
    																					<br />Santa Barbara, CA 93108
    																					</p>
    																					<p class="style5">RECEIPTS MUST BE RECEIVED WITHIN 45 DAYS 
    																					<span class="style2">FROM THE DATE OF NOTIFICATION.</span>
    																					</p>
    																					<p class="style2">A check will be made out directly to the teacher and mailed to their home address within 14 business days. If receipts are not turned in within the 45 days the monies awarded will go back into the fund so that we may fill other grant requests.</p>
    																					<p class="style2">If you cannot email your request please send the application form to:</p>
    																					<p class="style2">Village Properties Teacher's Fund
    																					<br />c/o Renee Grubb
    																					<br />1250 Coast Village Road
    																					<br />Santa Barbara, CA 93108
    																					</p>
    																					<p class="style2">or</p>
    																					<p>
    																					<span class="style2">If you have any questions please contact:
    																					<br />Dawn Villone at <a href="maIlto:dawn@echomediainc.com">dawn@echomediainc.com</a>
    																					</span>
    																					</p>
    																				</td>
    																				<br /><br />
    																			</tr>
    																		</tbody>
    																	</table>
    																</div>
    																<div align="center">
    																	<table cellSpacing="0" cellPadding="0" width="534" border="0">
    																		<tbody>
    																			<tr>
    																				<td valign="top" width="462" rowspan="3">
    																					<form method="post" action="send_contact.php">
    																					<INPUT TYPE="hidden" NAME="required" VALUE="Teacher_Name,Teacher_Home_Address,Teacher_City,Teacher_State,Teacher_Zip_Code,Teacher_Home_Phone,Teacher_Email_Address,School_Name,Grade_Level,School_Street_Address,School_City,School_State,School_Zip_Code,School_Phone,No_of_Students_Benefited,Donation_Description">
    																					<div align="center">
    																						<center>
    																							<table cellSpacing="2" cellPadding="2" width="594" align="center"  >
    																								<tbody>
    																									<tr >
    																										<td border color="#ffffff" colSpan="2">
    																											<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Teacher's Name:<br />
    																											</font>
    																											<font face="Arial, Helvetica, sans-serif" size="1">
    																											<INPUT tabIndex="1" size="32" name="Teacher_Name">
    																											</font>
    																										</td>
    																										<td colSpan="2">
    																											<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Home Address:<br />
    																											</font>
    																											<font face="Arial, Helvetica, sans-serif" size="1">
    																											<INPUT tabIndex="2" size="32" name="Teacher_Home_Address">
    																											</font>
    																										</td>
    																										</tr>
    																										<tr >
    																											<td colSpan="2">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">City:<br />
    																												<INPUT tabIndex="3" size="32" name="Teacher_City">
    																												</font>
    																											</td>
    																											<td colspan="2">
    																												<table cellSpacing="2" cellPadding="2" width="221" border="0">
    																													<tbody>
    																														<tr>
    																															<td width=80>
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">State:<br />
    																																</font>
    																																<font face="Arial, Helvetica, sans-serif" size="1">
    																																<INPUT tabIndex="4" size="5" name="Teacher_State">
    																																</font>
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">&nbsp;</font>
    																															</td>
    																															<td width="194">
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Zip Code:<br />
    																																<INPUT tabIndex="5" size="12" name="Teacher_Zip_Code">
    																																</font>
    																															</td>
    																														</tr>
    																													</tbody>
    																												</table>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td colSpan="2">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Home Telephone:<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<INPUT tabIndex="6" size="32" name="Teacher_Home_Phone">
    																												</font>
    																											</td>
    																											<td colSpan="2">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Email Address :<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<INPUT tabIndex="7" size="32" name="Teacher_Email_Address">
    																												</font>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td width="31%">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">School:<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<INPUT tabIndex="8" size="25" name="School_Name">
    																												</font>
    																											</td>
    																											<td width="20%">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Grade You Teach:<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<INPUT id="Grade_Level" tabIndex="11" size="5" name="Grade_Level">
    																												</font>
    																											</td>
    																											<td colSpan="2">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">School Address:<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<INPUT tabIndex="9" size="32" name="School_Street_Address">
    																												</font>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td colSpan="2" height="40">
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<font color="#000000">City:<br />
    																												<INPUT tabIndex="10" size="32" name="School_City">
    																												<br />
    																												</font>
    																												</font>
    																											</td>
    																											<td colSpan="2" height="40">
    																												<table cellSpacing="2" cellPadding="2" width="221" border="0">
    																													<tbody>
    																														<tr>
    																															<td width="80">
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">State:<br />
    																																</font>
    																																<font face="Arial, Helvetica, sans-serif" size="1">
    																																<INPUT tabIndex="11" size="5" name="School_State">
    																																</font>
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">&nbsp;</font>
    																															</td>
    																															<td width="194">
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Zip Code:<br />
    																																<INPUT tabIndex="12" size="12" name="School_Zip_Code">
    																																</font>
    																															</td>
    																														</tr>
    																													</tbody>
    																												</table>
    																											</td>
    																										</tr>
    																										<tr >	
    																											<td colSpan="2" height="50">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">School Telephone:<br />
    																												<INPUT tabIndex="13" size="32" name="School_Phone">
    																												</font>
    																											</td>
    																											<td width="24%">
    																												<div align="center">
    																													<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Dollar Amount Requested:<br />
    																													</font>
    																													<font face="Arial, Helvetica, sans-serif" size="1">
    																													<B>$
    																													<INPUT style="width:60px; HEIGHT: 22px" tabIndex="15" name="Amount_Requested">
    																													</B>
    																													</font>
    																													<font face="Arial, Helvetica, sans-serif" size="1">&nbsp;
    																													</font>
    																													<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">&nbsp;</font>
    																												</div>
    																											</td>
    																											<td width="25%">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">How many students will this benefit</font>
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">:<br />
    																												<INPUT id="No_of_Students_Benefited" tabIndex="12" size="12" name="No_of_Students_Benefited">
    																												</font>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td colSpan="4">
    																												<div align="center">
    																													<font face="Arial, Helvetica, sans-serif" size="1"></font>&nbsp;
    																												</div>
    																												<font face="Arial, Helvetica, sans-serif" size="1">Brief description of what the donation will be used for. <em>If you are requesting more than one item, please itemize the costs associated with each item. In many cases we may not be able to reward all the dollars requested. If you are able to take a portion of the dollars please indicate that in the box highlighted in red above.</em><br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<textarea tabIndex="16" name="Donation_Description" rows="10" cols="85"></textarea>
    																												</font>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td colSpan="4" height="39">
    																												<div align="center"><font face="Arial, Helvetica, sans-serif" size="1">
    																													<input type="submit" value="Submit Form" name="submit">
    																													<font face="Arial, Helvetica, sans-serif" size="1"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
    																													<font face="Arial, Helvetica, sans-serif" size="1">
    																													<INPUT type="reset" value="Clear Form" name="reset">
    																													</font>
    																													</font>
    																												</div>
    																											</td>
    																										</tr>
    																									</tbody>
    																								</table>
    																							</center>
    																						</div>
    																					</form>
    																				</td>
    																			</tr>
    																		</tbody>
    																	</table>
    																</div>
    															</td>
    														</tr>
    														<tr >
    															<td vAlign="top" height="39">
    																<div align="center"> <br />
    																</div>
    																<hr>
    																	<table width="96%" border="0">
    																		<tbody>
    																			<tr>
    																				<td vAlign="top" width="37%" height="54">
    																					<P>
    																					<font face="Arial, Helvetica, sans-serif" color="#333333" size="1">www.villagesite.com<br />
    																					</font>
    																					<font face="Arial, Helvetica, sans-serif" color="#333333" size="-3">Copyright 2009&copy; All Rights Reserved</font>
    																					<font face="Arial, Helvetica, sans-serif" color="#000000" size="1"><br />
    																					</font>
    																					<font face="Arial, Helvetica, sans-serif" color="#000000" size="-3"></font>
    																					</P>
    																				</td>
    																				<td vAlign="center"  colSpan="2" height="54">
    																					<div align="center">
    																						<p>
    																						<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">
    																						<a href="http://villagesite.com/">
    																						<font color="#990000">Return to<br /> Village Properties</font>
    																						</a>
    																						</font>
    																						</p>
    																					</div>
    																				</td>
    																				<td vAlign="top" width="40%" height="54">
    																					<div align="right">
    																						<p>
    																						<font face="Arial, Helvetica, sans-serif" color="#333333" size="1">
    																						Village Properties<br />
    																						Teacher's Fund<br />
    																						Dawn Villone<br />
    																						</font>
    																						<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">805-705-3337</font>
    																						<font face="Arial, Helvetica, sans-serif" color="#333333" size="1"><br /> email</font>
    																						<font face="Arial, Helvetica, sans-serif" color="#000000" size=1>
    																						<a href="mailto:dawn@echomediainc.com">
    																						<font color="#990000">dawn@echomediainc.com</font>
    																						</a>
    																						</font>
    																						</p>
    																					</div>
    																				</td>
    																			</tr>
    																		</tbody>
    																	</table>
    																</td>
    															</tr>
    														</tbody>
    													</table>
    												</td>
    											</tr>
    										</table>
    									</td>
    								</tr>
    								<tr>
    									<td height="19" colspan="2">
    										<table width="76%" height="19" align="center" cellpadding="0" cellspacing="0">
    											<tr>
    												<td align="right">
    													<img src="images/footer.gif" width="442" height="11" vspace="6" />
    												</td>
    											</tr>
    										</table>
    									</td>
    								</tr>
    							</table>
    						</td>
    					</tr>
    				</table>
    				<p>&nbsp;</p>
    				<p>&nbsp;</p>
    			</td>
    		</tr>
    	</table>
    </body>
    </html>
    and this is the send_contact.php file

    Code:
    <?php
    // Contact subject
    $subject ="$Teacher_Name";
    // Details
    $message="($Teacher_Name,$Teacher_Home_Address,$Teacher_City,$Teacher_State,$Teacher_Zip_Code,$Teacher_Home_Phone,$Teacher_Email_Address,$School_Name,$Grade_Level,$School_Street_Address,$School_City,$School_State,$School_Zip_Code,$School_Phone,$No_of_Students_Benefited,$Donation_Description)";
    
    // Mail of sender
    $mail_from="$Teacher_Email_Address";
    // From
    $header="from: $Teacher_Name <$mail_from>";
    
    // Enter your email address
    $to ='gbboss429@gmail.com';
    
    $send_contact=mail($to,$subject,$message,$header);
    // Check, if message sent to your email
    // display message "We've received your information"
    if($send_contact){
    echo "We've received your contact information";
    }
    else {
    echo "ERROR";
    }
    ?>
    Thanks for any help, Chris.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,226
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)
    The script is relying on global variables being configured "on". eg.
    $subject ="$Teacher_Name";

    If you change the code to eg.
    $subject = $_POST'Teacher_Name'];

    it should work better.

    BTW, do yourself a big favor and validate all user supplied input before using it to send emails. You don't want the form being used to send SPAM from your server.

  3. #3
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to specify the form method in which values are being sent/received.

    PHP Code:
    $Teacher_Name $_POST['Teacher_Name'];
    $subject $Teacher_Name;

    $Teacher_Home_Address $_POST['Teacher_Home_Address'];
    $Teacher_City $_POST['Teacher_City'];
    $Teacher_Email_Address $_POST['Teacher_Email_Address'];

    // Details
    $message="($Teacher_Name$Teacher_Home_Address$Teacher_City$Teacher_Email_Address)";

    // Mail of sender
    $mail_from $Teacher_Email_Address;
    // From
    $header "From: $Teacher_Name <$mail_from>"

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does this look better?

    Code:
     <?php
    // Contact subject
    $Teacher_Name = $_POST['Teacher_Name'];
    $subject ="$Teacher_Name";
    // Details
    
    $Teacher_Name = $_POST['Teacher_Name'];
    $Teacher_Home_Address = $_POST['Teacher_Home_Address'];
    $Teacher_City = $_POST['Teacher_City'];
    $Teacher_State = $_POST['Teacher_State'];
    $Teacher_Zip_Code = $_POST['Teacher_Zip_Code'];
    $Teacher_Home_Phone = $_POST['Teacher_Home_Phone'];
    $School_Name = $_POST['School_Name'];
    $Grade_Level = $_POST['Grade_Level'];
    $School_Street_Address = $_POST['School_Street_Address'];
    $School_City = $_POST['School_City'];
    $School_State = $_POST['School_State'];
    $School_Zip_Code = $_POST['School_Zip_Code'];
    $School_Phone = $_POST['School_Phone'];
    $No_of_Students_Benefited = $_POST['No_of_Students_Benefited'];
    $Donation_Description = $_POST['Donation_Description'];
    
    
    $message="($Teacher_Name,$Teacher_Home_Address,$Teacher_City,$Teacher_State,$Teacher_Zip_Code,$Teacher_Home_Phone,$Teacher_Email_Address,$School_Name,$Grade_Level,$School_Street_Address,$School_City,$School_State,$School_Zip_Code,$School_Phone,$No_of_Students_Benefited,$Donation_Description)";
    
    // Mail of sender
    $mail_from="$Teacher_Email_Address";
    // From
    $header="from: $Teacher_Name <$mail_from>";
    
    // Enter your email address
    $to ='gbboss429@gmail.com';
    
    $send_contact=mail($to,$subject,$message,$header);
    // Check, if message sent to your email
    // display message "We've received your information"
    if($send_contact){
    echo "We've received your contact information";
    }
    else {
    echo "ERROR";
    }
    ?>

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here are the updated codes

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Welcome 2 Village Properties Teacher Fund </title>
    <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    <!--
    body {
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    	background-color: #EAECD7;
    	background-image="images/index_02.gif"
    }
    .style1 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 14px;
    	font-weight: bold;
    	color: #989933;
    }
    .style2 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 11px;
    	line-height: 20px;
    	color: #000000;
    }
    .style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 20px; color: #990000; }
    
    -->
    
    </style>
    </head>
    <body>
    	<table width="1003" cellspacing="0" cellpadding="0">
    		<tr>
    			<td valign="top" >
    				<table width="100&#37;" cellspacing="0" cellpadding="0">
    					<tr>
    						<td height="40" colspan="3">&nbsp;</td>
    					</tr>
    					<tr>
    						<td colspan="3"><table width="100%" cellspacing="0" cellpadding="0">
    							<tr>
    								<td width="72%" height="103" align="right" valign="bottom">
    									<table width="87%" cellspacing="0" cellpadding="0" >
    										<tr>
    											<td width="5%">&nbsp;</td>
    											<td width="77%">
    												<a href="http://www.villagesite.com"><img src="images/index_06.gif" alt="" width="273" height="58" border="0" /></a>
    											</td>
    											<td width="18%">&nbsp;</td>
    										</tr>
    										<tr>
    											<td width="5%" height="39">&nbsp;</td>
    											<td width="77%" height="39">
    												<img src="images/index_081.gif" width="491" height="21" alt="" />
    											</td>
    											<td width="18%" height="39" valign="bottom">
    												<a href="http://www.teachersfund.org/">
    												<img src="images/index_return.gif" alt="" width="110" height="21" border="0" />
    												</a>
    											</td>
    										</tr>
    									</table>
    								</td>
    								<td width="28%" height="103">
    									<img src="images/teachers_fund.gif" alt="" width="138" height="92" hspace="5" vspace="3" />
    								</td>
    							</tr>
    							<tr>
    								<td height="19" colspan="2">
    									<table width="82%" align="center" cellpadding="0" cellspacing="0">
    										<tr >
    											<td>
    												<table width="755" class="border" align="center" cellpadding="0" bgcolor="#F4F5EB">
    													<tbody>
    														<tr>
    															<td valign="top" >
    																<div align="center">
    																	<table cellspacing="6" cellpadding="2" width="98%" border="0">
    																		<tbody>
    																			<tr >
    																				<td colspan="2">
    																					<div align="center" class="style1">
    																						<font face="Arial, Helvetica, sans-serif" color="#990000">
    																						<strong>HOW THE PROGRAM WORKS</strong>
    																						</font>
    																					</div>
    																				</td>
    																			</tr>
    																			<tr >
    																				<td width="50%" valign="top" >
    																					<p>
    																					<span class="style2">Please click on the link listed below and fill out the simple grant request. No amount is too small. Please make sure to fill out the request in its entirety and include your personal phone number and personal email so that we may get in touch with you if necessary. All information is kept confidential and will only be used in an effort to contact you in regards to your request. We have found it difficult to notify teachers through the schools by phone or email due to filters or blocks. 
    																					<br /><br />
    																					Applications may be submitted September 1st - April 30th to be considered for the current school year. Applications received after April 30th will be considered for the next school year and will be reviewed in September.
    																					</span>
    																					</p>
    																					<p>
    																					<span class="style2">The Teacher's Fund judges committee meets within the first two weeks of each month to review the previous month's applications.</span>
    																					</p>
    																					<p class="style2">Requests must be received by the last day of the month in order to be considered for the upcoming month's donations. Requests received after the last day of the month will be considered the following month. For example, if you submit a request on October 31st, your request will be reviewed in November.</p>
    																				</td>
    																				<td valign="top" width="50%">
    																					<p class="style5">Notification letters will be <b>EMAILED</b> to all applicants by the end of the month. It is <b>IMPERATIVE THAT YOU PROVIDE YOUR HOME EMAIL ADDRESS</b>, as many of the school's filters will not allow the notification letters through. 
    																					</p>
    																					<p class="style2">Once you receive notification, simply purchase the items you requested and mail the original receipts, along with your notification letter, to:</p>
    																					<p class="style2">Village Properties Teacher's Fund
    																					<br />c/o Donna Jordan
    																					<br />1250 Coast Village Road
    																					<br />Santa Barbara, CA 93108
    																					</p>
    																					<p class="style5">RECEIPTS MUST BE RECEIVED WITHIN 45 DAYS 
    																					<span class="style2">FROM THE DATE OF NOTIFICATION.</span>
    																					</p>
    																					<p class="style2">A check will be made out directly to the teacher and mailed to their home address within 14 business days. If receipts are not turned in within the 45 days the monies awarded will go back into the fund so that we may fill other grant requests.</p>
    																					<p class="style2">If you cannot email your request please send the application form to:</p>
    																					<p class="style2">Village Properties Teacher's Fund
    																					<br />c/o Renee Grubb
    																					<br />1250 Coast Village Road
    																					<br />Santa Barbara, CA 93108
    																					</p>
    																					<p class="style2">or</p>
    																					<p class="style2">If you have any questions please contact:
    																					<br />Dawn Villone at <a href="maIlto:dawn@echomediainc.com">dawn@echomediainc.com</a>
    																					</p>
    																					<br /><br />
    																				</td>
    																			</tr>
    																		</tbody>
    																	</table>
    																</div>
    																<div align="center">
    																	<table cellspacing="0" cellpadding="0" width="534" border="0">
    																		<tbody>
    																			<tr>
    																				<td valign="top" width="462" rowspan="3">
    																					<form method="post" action="send_contact.php">
    																					<input type="hidden" name="required" value="Teacher_name,Teacher_Home_Address,Teacher_City,Teacher_State,Teacher_Zip_Code,Teacher_Home_Phone,Teacher_Email_Address,School_name,Grade_Level,School_Street_Address,School_City,School_State,School_Zip_Code,School_Phone,No_of_Students_Benefited,Donation_Description" />
    																					<div align="center">
    																						<center>
    																							<table cellspacing="2" cellpadding="2" width="594" align="center"  >
    																								<tbody>
    																									<tr >
    																										<td colspan="2">
    																											<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Teacher's name:<br />
    																											</font>
    																											<font face="Arial, Helvetica, sans-serif" size="1">
    																											<input tabindex="1" size="32" name="Teacher_name" />
    																											</font>
    																										</td>
    																										<td colspan="2">
    																											<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Home Address:<br />
    																											</font>
    																											<font face="Arial, Helvetica, sans-serif" size="1">
    																											<input tabindex="2" size="32" name="Teacher_Home_Address" />
    																											</font>
    																										</td>
    																										</tr>
    																										<tr >
    																											<td colspan="2">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">City:<br />
    																												<input tabindex="3" size="32" name="Teacher_City" />
    																												</font>
    																											</td>
    																											<td colspan="2">
    																												<table cellspacing="2" cellpadding="2" width="221" border="0">
    																													<tbody>
    																														<tr>
    																															<td width="80">
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">State:<br />
    																																</font>
    																																<font face="Arial, Helvetica, sans-serif" size="1">
    																																<input tabindex="4" size="5" name="Teacher_State" />
    																																</font>
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">&nbsp;</font>
    																															</td>
    																															<td width="194">
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Zip Code:<br />
    																																<input tabindex="5" size="12" name="Teacher_Zip_Code" />
    																																</font>
    																															</td>
    																														</tr>
    																													</tbody>
    																												</table>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td colspan="2">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Home Telephone:<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<input tabindex="6" size="32" name="Teacher_Home_Phone" />
    																												</font>
    																											</td>
    																											<td colspan="2">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Email Address :<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<input tabindex="7" size="32" name="Teacher_Email_Address" />
    																												</font>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td width="31%">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">School:<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<input tabindex="8" size="25" name="School_name" />
    																												</font>
    																											</td>
    																											<td width="20%">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Grade You Teach:<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<input id="Grade_Level" tabindex="11" size="5" name="Grade_Level" />
    																												</font>
    																											</td>
    																											<td colspan="2">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">School Address:<br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<input tabindex="9" size="32" name="School_Street_Address" />
    																												</font>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td colspan="2" height="40">
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<font color="#000000">City:<br />
    																												<input tabindex="10" size="32" name="School_City" />
    																												<br />
    																												</font>
    																												</font>
    																											</td>
    																											<td colspan="2" height="40">
    																												<table cellspacing="2" cellpadding="2" width="221" border="0">
    																													<tbody>
    																														<tr>
    																															<td width="80">
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">State:<br />
    																																</font>
    																																<font face="Arial, Helvetica, sans-serif" size="1">
    																																<input tabindex="11" size="5" name="School_State" />
    																																</font>
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">&nbsp;</font>
    																															</td>
    																															<td width="194">
    																																<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Zip Code:<br />
    																																<input tabindex="12" size="12" name="School_Zip_Code" />
    																																</font>
    																															</td>
    																														</tr>
    																													</tbody>
    																												</table>
    																											</td>
    																										</tr>
    																										<tr >	
    																											<td colspan="2" height="50">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">School Telephone:<br />
    																												<input tabindex="13" size="32" name="School_Phone" />
    																												</font>
    																											</td>
    																											<td width="24%">
    																												<div align="center">
    																													<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">Dollar Amount Requested:<br />
    																													</font>
    																													<font face="Arial, Helvetica, sans-serif" size="1">
    																													<b>$
    																													<input style="width:60px; HEIGHT: 22px" tabindex="15" name="Amount_Requested" />
    																													</b>
    																													</font>
    																													<font face="Arial, Helvetica, sans-serif" size="1">&nbsp;
    																													</font>
    																													<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">&nbsp;</font>
    																												</div>
    																											</td>
    																											<td width="25%">
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">How many students will this benefit</font>
    																												<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">:<br />
    																												<input id="No_of_Students_Benefited" tabindex="12" size="12" name="No_of_Students_Benefited" />
    																												</font>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td colspan="4">
    																												<div align="center">
    																													<font face="Arial, Helvetica, sans-serif" size="1"></font>&nbsp;
    																												</div>
    																												<font face="Arial, Helvetica, sans-serif" size="1">Brief description of what the donation will be used for. <em>If you are requesting more than one item, please itemize the costs associated with each item. In many cases we may not be able to reward all the dollars requested. If you are able to take a portion of the dollars please indicate that in the box highlighted in red above.</em><br />
    																												</font>
    																												<font face="Arial, Helvetica, sans-serif" size="1">
    																												<textarea tabindex="16" name="Donation_Description" rows="10" cols="85"></textarea>
    																												</font>
    																											</td>
    																										</tr>
    																										<tr >
    																											<td colspan="4" height="39">
    																												<div align="center"><font face="Arial, Helvetica, sans-serif" size="1">
    																													<input type="submit" value="Submit Form" name="submit" />
    																													<font face="Arial, Helvetica, sans-serif" size="1"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
    																													<font face="Arial, Helvetica, sans-serif" size="1">
    																													<input type="reset" value="Clear Form" name="reset" />
    																													</font>
    																													</font>
    																												</div>
    																											</td>
    																										</tr>
    																									</tbody>
    																								</table>
    																							</center>
    																						</div>
    																					</form>
    																				</td>
    																			</tr>
    																		</tbody>
    																	</table>
    																</div>
    															</td>
    														</tr>
    														<tr >
    															<td valign="top" height="39">
    																<div align="center"> <br />
    																</div>
    																<hr />
    																	<table width="96%" border="0">
    																		<tbody>
    																			<tr>
    																				<td valign="top" width="37%" height="54">
    																					<p>
    																					<font face="Arial, Helvetica, sans-serif" color="#333333" size="1">www.villagesite.com<br />
    																					</font>
    																					<font face="Arial, Helvetica, sans-serif" color="#333333" size="-3">Copyright 2009&copy; All Rights Reserved</font>
    																					<font face="Arial, Helvetica, sans-serif" color="#000000" size="1"><br />
    																					</font>
    																					<font face="Arial, Helvetica, sans-serif" color="#000000" size="-3"></font>
    																					</p>
    																				</td>
    																				<td valign="middle"  colspan="2" height="54">
    																					<div align="center">
    																						<p>
    																						<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">
    																						<a href="http://villagesite.com/">
    																						<font color="#990000">Return to<br /> Village Properties</font>
    																						</a>
    																						</font>
    																						</p>
    																					</div>
    																				</td>
    																				<td valign="top" width="40%" height="54">
    																					<div align="right">
    																						<p>
    																						<font face="Arial, Helvetica, sans-serif" color="#333333" size="1">
    																						Village Properties<br />
    																						Teacher's Fund<br />
    																						Dawn Villone<br />
    																						</font>
    																						<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">805-705-3337</font>
    																						<font face="Arial, Helvetica, sans-serif" color="#333333" size="1"><br /> email</font>
    																						<font face="Arial, Helvetica, sans-serif" color="#000000" size="1">
    																						<a href="mailto:dawn@echomediainc.com">
    																						<font color="#990000">dawn@echomediainc.com</font>
    																						</a>
    																						</font>
    																						</p>
    																					</div>
    																				</td>
    																			</tr>
    																		</tbody>
    																	</table>
    																</td>
    															</tr>
    														</tbody>
    													</table>
    												</td>
    											</tr>
    										</table>
    									</td>
    								</tr>
    								<tr>
    									<td height="19" colspan="2">
    										<table width="76%" align="center" cellpadding="0" cellspacing="0">
    											<tr >
    												<td align="right">
    													<img src="images/footer.gif" alt="" width="442" height="11" vspace="6" />
    												</td>
    											</tr>
    										</table>
    									</td>
    								</tr>
    							</table>
    						</td>
    					</tr>
    				</table>
    				<p>&nbsp;</p>
    				<p>&nbsp;</p>
    			</td>
    		</tr>
    	</table>
    </body>
    </html>
    and the send_contact.php

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Welcome 2 Village Properties Teacher Fund </title>
    </head>
    <body>
    <?php
    // Contact subject
    $Teacher_Name = $_POST['Teacher_Name'];
    $subject ="$Teacher_Name";
    // Details
    
    $Teacher_Name = $_POST['Teacher_Name'];
    $Teacher_Home_Address = $_POST['Teacher_Home_Address'];
    $Teacher_City = $_POST['Teacher_City'];
    $Teacher_State = $_POST['Teacher_State'];
    $Teacher_Zip_Code = $_POST['Teacher_Zip_Code'];
    $Teacher_Home_Phone = $_POST['Teacher_Home_Phone'];
    $School_Name = $_POST['School_Name'];
    $Grade_Level = $_POST['Grade_Level'];
    $School_Street_Address = $_POST['School_Street_Address'];
    $School_City = $_POST['School_City'];
    $School_State = $_POST['School_State'];
    $School_Zip_Code = $_POST['School_Zip_Code'];
    $School_Phone = $_POST['School_Phone'];
    $No_of_Students_Benefited = $_POST['No_of_Students_Benefited'];
    $Donation_Description = $_POST['Donation_Description'];
    
    
    $message="($Teacher_Name,$Teacher_Home_Address,$Teacher_City,$Teacher_State,$Teacher_Zip_Code,$Teacher_Home_Phone,$Teacher_Email_Address,$School_Name,$Grade_Level,$School_Street_Address,$School_City,$School_State,$School_Zip_Code,$School_Phone,$No_of_Students_Benefited,$Donation_Description)";
    
    // Mail of sender
    $Teacher_Email_Address = $_POST['Teacher_Email_Address'];
    $mail_from="$Teacher_Email_Address";
    // From
    $header="from: $Teacher_Name <$mail_from>";
    
    // Enter your email address
    $to ='gbboss429@gmail.com';
    
    $send_contact=mail($to,$subject,$message,$header);
    // Check, if message sent to your email
    // display message "We've received your information"
    if($send_contact){
    echo "We've received your contact information";
    }
    else {
    echo "ERROR";
    }
    ?>
    </body>
    </html>
    I have validated both codes through the W3C validator but I still am not receiving the emails to the address indicated "gbboss429@gmail.com"

    I don't know if it takes a long time or what?

    What other troubling shooting should I do? I believe the code is correct now but I don't get anything in my inbox.

    Thanks

  7. #7
    SitePoint Zealot
    Join Date
    Apr 2009
    Location
    South Florida
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    always use regex to validate email addresses before passing into email header, otherwise spammers will take the advantage of your script
    http://us.php.net/function.mail

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,226
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)
    It may not be a problem with your code. If you do a simple
    PHP Code:
    <?php
    mail
    ('your@email.com''test''This is a test');
    ?>
    do you get it?

    BTW, I suggest you edit out the email address in your posts before they become SPAM bait.

  9. #9
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK I am getting a response now.

    Just missing one thing. For some reason the subject part of the email does not work and the teacher name does not show up in the message part of the email.

    Any thoughts??

  10. #10
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never mind I got it.

  11. #11
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    New problem:

    How can I send this contact form to multiple email addresses?
    thanks

  12. #12
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The mail function in the PHP manual has some good examples.
    PHP Code:
    $to 'address1@somewhere.com,address2@somewhere.com,address3@somewhere.com'

  13. #13
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I don't know why that was not working for me before. Probably because I am an idiot sometimes. but, it is working now..

  14. #14
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,226
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)
    If you weren't getting the "ERROR" echo, it may have been working but the email got stuck in a bottle neck somewhere. Maybe your email server's or your email client's queue? Email isn't "instant" messaging, although in my experience I've never had to wait for more than a half hour or so when testing. And usually much much less.

  15. #15
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not sure how to write the code to prevent the spam. I have tried a few different things but none seem to work.

    Can someone help please?

  16. #16
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Mittineague meant on post #6 you have placed your email address, you should delete it out before spammers get hold of it.
    "Don't you just love it when you solve a programming bug only to create another."

  17. #17
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Location
    Santa Barbara, CA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes but I have seen that there are ways to prevent spammers from using my PHP form and I can not seem to make any of them work.

    That is my question

  18. #18
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Ah I see, well you could do a check with each field for any certain words. One of my websites was targeted with sex spam messages where the visitor would fill in the form with nonsence then include links to porn sites in the message field box, so I came up with this:

    PHP Code:
    // list of words to look out for
    $words = array('sex''what''next''and''more');

    //check for spam words
    $check_message $_POST['message'];
    $check_name $_POST['name'];
    $check_phone $_POST['phone'];
    $check_email $_POST['email'];
    $check_subject $_POST['subject'];

    // loop through to check each word exists
    foreach($words as $word) {
          if (
    preg_match("/$word/i""$check_message$check_name$check_phone$check_email$subject")) {
                 
    $countwords++;
          }
    }

    // check how many counted words has been found, in any
    if($countwords 0) {
    // display the error message with the number of words found         
     
    echo '<strong>'.$countwords.' Spam words</strong> have been found.</p>
                     <p class="maintext">Making it impossible to send your message.</p>'
    ;
    }else{
    // mail the message          
    mail(the message);

    // display the thank you message
    echo 'Thank you, your message has been sent';

    I hope the above code is any use for you as it is for me.
    "Don't you just love it when you solve a programming bug only to create another."


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •