Jump to content

help with PHP form


uvaldez
 Share

Recommended Posts

would appreciate some help please. i have a website created in php and would like to fix the form in my code. i would like to know how can i tell the form to send the information being input in the form to a specific email address. heres the current 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" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><link rel="stylesheet" href="css/style.css"/><title>FREETRAVEL4YOU - SIGN UP</title></head><body>    <div class="main">        <div class="mTop" style="height:560px;">	        <div class="header">		        <div class="wrap">			        <a href="#" class="logo1"></a>				    <a href="#" class="logo2"></a>				    <ul>				        <li>					        <a href="index.html" target="_self">						        Home						    </a>					    </li>					    <li>					        <a href="#" target="_self">						        Overview						    </a>					    </li>					    <li>					        <a href="#" target="_self">						        About Us						    </a>					    </li>					    <li>					        <a href="#" target="_self">						        Questions						    </a>					    </li>					    <li>					        <a href="Contact.html" target="_self">						        Contact Us						    </a>					    </li>					    <li>					        <a href="signup.html" target="_self" class="selected">						        Sign Up						    </a>					    </li>					    <div class="clear"></div>				    </ul>				    <div class="clear"></div>			    </div>			    <!--end wrap-->		    </div>		    <!--end header-->	        <div class="wrap">				    <h2 class="tH" style="font-size:26px;">					    Sign Up For More Information On Being An Atlantic Travel Associate.				    </h2>				    <p style="font-size:13px;line-height:18px;">				        Don't miss this exciting opportunity to get in on the FUN! Getting started with your very own home based business is fast,					    easy, and most importantly FREE! To Request more information, please provide the following and then click the Request More Information button.				    </p>				    <div class="sform">				        <p>					        First Name:					    </p>					    <input type="text" name="" id="" class="inpu-1" />					    <p>					        MI Name:					    </p>					    <input type="text" name="" id="" class="inpu-2" />					    <p>					        Last Name:					    </p>					    <input type="text" name="" id="" class="inpu-2" style="float:right;"/>					    <div class="clear"></div>					    <p>					        Home Address:					    </p>					    <input type="text" name="" id="" class="inpu-3" />					    <div class="clear"></div>					    <p>					        Mailing Address					    </p>					    <div class="clear" style="height:10px;"></div>					    <p>					        City:					    </p>					    <input type="text" name="" id="" class="inpu-4" />					    <p>					        St:					    </p>					    <input type="text" name="" id="" class="inpu-5" />					    <p>					        Country:					    </p>					    <input type="text" name="" id="" class="inpu-6" style="margin:0 15px 0 0;"/>					    <p>					        Zip:					    </p>					    <input type="text" name="" id="" class="inpu-6" />					    <div class="clear"></div>					    <p>					        Home Phone:					    </p>					    <input type="text" name="" id="" class="inpu-7" />					    <p>					        Cell Phone:					    </p>					    <input type="text" name="" id="" class="inpu-7" />					    <p>					        Email:					    </p>					    <input type="text" name="" id="" class="inpu-7" style="float:right;"/>					    <div class="clear"></div>					    <p>					        Best Time To Reach You:					    </p>					    <input type="text" name="" id="" class="inpu-8" />					    <div class="clear"></div>					    <p>					        Have You Sold Travel Before?					    </p>					    <input type="text" name="" id="" class="inpu-9" />					    <div class="clear"></div>					    <p>					        Tell Us About Yourself:					    </p>					    <input type="text" name="" id="" class="inpu-10" />					    <div class="clear" style="height:0;"></div>				    </div>    				    <!--end sform-->		    </div>		    <!--end wrap-->	    </div>	    <!--end ATOP-->	    <div class="mid">	        <div class="sform" style="margin-top:0;">		        					    <p>					        Questions You May Have:					    </p>					    <input type="text" name="" id="" class="inpu-11" />					    <div class="clear"></div>					    <input type="checkbox" name="" id="" class="inpu-12" />					    <p>					        Yes I am 18 or older and have solicited this information					    </p>					    <div class="clear"></div>		    </div>		    <!--end wrap--->	    </div>    	    <!--end mid-->	    </div>        <!----end main div---->	    <div class="footer">	        <div class="wrap">		        <ul>			        <li>				        <h2>					        Atlantic Travel					    </h2>					    <div class="cont">					        <a href="#" target="_self">						        About     US						    </a>						    <br />						    <a href="#" target="_self">						        Privacy						    </a>						    <br />						    <a href="#" target="_self">						        FAM Trips						    </a>					    </div>				    </li>				    <li>				        <h2>					        Reach Us					    </h2>					    <div class="cont">					        <a href="#" target="_self">						        Contact						    </a><br />						    <a href="#" target="_self">						        Testimonials						    </a><br />						    <a href="#" target="_self">						        Cruise Classes						    </a><br />						    <a href="#" target="_self">						        Clear Agent						    </a>					    </div>				    </li>				    <li>				        <h2>					        FreeTravel4You!					    </h2>					    <div class="cont">					        <a href="#" target="_self">						        Overview						    </a><br />						    <a href="#" target="_self">						        Frequent Questions						    </a><br />						    <a href="#" target="_self">						        Sign Up						    </a><br />						    <a href="#" target="_self">						        Live Presentation						    </a>					    </div>				    </li>				    <li>				        <h2>					        Our Brands					    </h2>					    <div class="cont">					        <a href="#" target="_self">						        Atlantic4Travel.com						    </a><br />						    <a href="#" target="_self">						        Atlantic4Travel.com						    </a><br />						    <a href="#" target="_self">						        Atlantic4Travel.com						    </a>					    </div>				    </li>				    <div class="clear"></div>			    </ul>			    <p style="text-align:center;font-size:10px;padding:34px 0 0 0;">			        Designed by <a href="http://www.designpax.com" target="_blank" style="color:#fff;text-decoration:none;">DesignPax</a>			    </p>		    </div>		    <!--end wrap-->	    </div>	    <!--end FOOTER-->    </body></html>

Link to comment
Share on other sites

First you need an actual form element on the page. Other than that, you don't "tell" the form what to do, the form just submits all of the data to your PHP page and then you write PHP code to do whatever you want with the form data, like put it in an email and send it. This is the section on how to process forms in general: http://www.w3schools.com/php/php_forms.asp And there's a basic example of using PHP to send an email here: http://www.w3schools.com/php/php_mail.asp

Link to comment
Share on other sites

can anyone please tell me where do i place this code i cant figure it out????

<html><body><?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email  {  //send email  $email = $_REQUEST['email'] ;  $subject = $_REQUEST['subject'] ;  $message = $_REQUEST['message'] ;  mail("someone@example.com", $subject,  $message, "From:" . $email);  echo "Thank you for using our mail form";  }else//if "email" is not filled out, display the form  {  echo "<form method='post' action='mailform.php'>  Email: <input name='email' type='text'><br>  Subject: <input name='subject' type='text'><br>  Message:<br>  <textarea name='message' rows='15' cols='40'>  </textarea><br>  <input type='submit'>  </form>";  }?></body></html>

Link to comment
Share on other sites

<html><body><?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email  {  //send email  $email = $_REQUEST['email'] ;  $subject = $_REQUEST['subject'] ;  $message = $_REQUEST['message'] ;  mail("someone@example.com", $subject,  $message, "From:" . $email);  echo "Thank you for using our mail form";  }else//if "email" is not filled out, display the form  {  echo "<form method='post' action='mailform.php'>  Email: <input name='email' type='text'><br>  Subject: <input name='subject' type='text'><br>  Message:<br>  <textarea name='message' rows='15' cols='40'>  </textarea><br>  <input type='submit'>  </form>";  }?></body></html>[code/]this code is supposed to go some where inside the code that is posted on the very first post. I cant get it to work for some reason ?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...