I know nothing about PHP....

If anyone can point me in the write direction here… I made this html form script for my website… how ever making a php mail script I’m clueless… any help would be awesome… am I making this more difficult then it is?

[code]

SkyEast Online Submision
<img id="top" src="top.png" alt="">
<div id="form_container">

	<h1><a>SkyEast Photo LLC Online Submision</a></h1>
	<form id="form_534695" class="appnitro"  method="post" action="">
				<div class="form_description">
		<h2>SkyEast Photo LLC Online Submision</h2>
		<p>Need Help? No Worries give us a call 10am-8pm Mon-Fri </p>
	</div>						
		<ul >
		
				<li id="li_1" >
	<label class="description" for="element_1">Name </label>
	<span>
		<input id="element_1_1" name= "element_1_1" class="element text" maxlength="255" size="8" value=""/>
		<label>First</label>
	</span>
	<span>
		<input id="element_1_2" name= "element_1_2" class="element text" maxlength="255" size="14" value=""/>
		<label>Last</label>
	</span> 
	</li>		<li id="li_3" >
	<label class="description" for="element_3">Phone </label>
	<span>
		<input id="element_3_1" name="element_3_1" class="element text" size="3" maxlength="3" value="" type="text"> -
		<label for="element_3_1">(###)</label>
	</span>
	<span>
		<input id="element_3_2" name="element_3_2" class="element text" size="3" maxlength="3" value="" type="text"> -
		<label for="element_3_2">###</label>
	</span>
	<span>
 		<input id="element_3_3" name="element_3_3" class="element text" size="4" maxlength="4" value="" type="text">
		<label for="element_3_3">####</label>
	</span>
	 
	</li>		<li id="li_4" >
	<label class="description" for="element_4">Email </label>
	<div>
		<input id="element_4" name="element_4" class="element text medium" type="text" maxlength="255" value=""/> 
	</div> 
	</li>		<li id="li_2" >
	<label class="description" for="element_2">Address </label>
	
	<div>
		<input id="element_2_1" name="element_2_1" class="element text large" value="" type="text">
		<label for="element_2_1">Street Address</label>
	</div>

	<div>
		<input id="element_2_2" name="element_2_2" class="element text large" value="" type="text">
		<label for="element_2_2">Address Line 2</label>
	</div>

	<div class="left">
		<input id="element_2_3" name="element_2_3" class="element text medium" value="" type="text">
		<label for="element_2_3">City</label>
	</div>

	<div class="right">
		<input id="element_2_4" name="element_2_4" class="element text medium" value="" type="text">
		<label for="element_2_4">State / Province / Region</label>
	</div>

	<div class="left">
		<input id="element_2_5" name="element_2_5" class="element text medium" maxlength="15" value="" type="text">
		<label for="element_2_5">Postal / Zip Code</label>
	</div>

	<div class="right">
		<select class="element select medium" id="element_2_6" name="element_2_6"> 
		<option value="" selected="selected"></option>
Afghanistan Albania Algeria Andorra Antigua and Barbuda Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia Bosnia and Herzegovina Botswana Brazil Brunei Bulgaria Burkina Faso Burundi Cambodia Cameroon Canada Cape Verde Central African Republic Chad Chile China Colombia Comoros Congo Costa Rica Côte d'Ivoire Croatia Cuba Cyprus Czech Republic Denmark Djibouti Dominica Dominican Republic East Timor Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Honduras Hong Kong Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Kiribati North Korea South Korea Kuwait Kyrgyzstan Laos Latvia Lebanon Lesotho Liberia Libya Liechtenstein Lithuania Luxembourg Macedonia Madagascar Malawi Malaysia Maldives Mali Malta Marshall Islands Mauritania Mauritius Mexico Micronesia Moldova Monaco Mongolia Montenegro Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands New Zealand Nicaragua Niger Nigeria Norway Oman Pakistan Palau Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Puerto Rico Qatar Romania Russia Rwanda Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines Samoa San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia and Montenegro Seychelles Sierra Leone Singapore Slovakia Slovenia Solomon Islands Somalia South Africa Spain Sri Lanka Sudan Suriname Swaziland Sweden Switzerland Syria Taiwan Tajikistan Tanzania Thailand Togo Tonga Trinidad and Tobago Tunisia Turkey Turkmenistan Tuvalu Uganda Ukraine United Arab Emirates United Kingdom United States Uruguay Uzbekistan Vanuatu Vatican City Venezuela Vietnam Yemen Zambia Zimbabwe
		</select>
	<label for="element_2_6">Country</label>
</div> 
	</li>		<li id="li_5" >
	<label class="description" for="element_5">Date </label>
	<span>
		<input id="element_5_1" name="element_5_1" class="element text" size="2" maxlength="2" value="" type="text"> /
		<label for="element_5_1">MM</label>
	</span>
	<span>
		<input id="element_5_2" name="element_5_2" class="element text" size="2" maxlength="2" value="" type="text"> /
		<label for="element_5_2">DD</label>
	</span>
	<span>
 		<input id="element_5_3" name="element_5_3" class="element text" size="4" maxlength="4" value="" type="text">
		<label for="element_5_3">YYYY</label>
	</span>

	<span id="calendar_5">
		<img id="cal_img_5" class="datepicker" src="calendar.gif" alt="Pick a date.">	
	</span>
	<script type="text/javascript">
		Calendar.setup({
		inputField	 : "element_5_3",
		baseField    : "element_5",
		displayArea  : "calendar_5",
		button		 : "cal_img_5",
		ifFormat	 : "%B %e, %Y",
		onSelect	 : selectDate
		});
	</script>
	 
	</li>		<li id="li_6" >
	<label class="description" for="element_6">Time </label>
	<span>
		<input id="element_6_1" name="element_6_1" class="element text " size="2" type="text" maxlength="2" value=""/> : 
		<label>HH</label>
	</span>
	<span>
		<input id="element_6_2" name="element_6_2" class="element text " size="2" type="text" maxlength="2" value=""/> : 
		<label>MM</label>
	</span>
	<span>
		<input id="element_6_3" name="element_6_3" class="element text " size="2" type="text" maxlength="2" value=""/>
		<label>SS</label>
	</span>
	<span>
		<select class="element select" style="width:4em" id="element_6_4" name="element_6_4">
			<option value="AM" >AM</option>
			<option value="PM" >PM</option>
		</select>
		<label>AM/PM</label>
	</span> 
	</li>		<li id="li_8" >
	<label class="description" for="element_8">Choose Your Package! </label>
	<div>
	<select class="element select medium" id="element_8" name="element_8"> 
		<option value="1" selected="selected">Standard Package ($159.99)</option>
Professional Package ($199.99) Ultimate Package ($249.99) Request Quote Request Quote for Aerial Photography
	</select>
	</div> 
	</li>		<li id="li_7" >
	<label class="description" for="element_7">Additional Comments </label>
	<div>
		<textarea id="element_7" name="element_7" class="element textarea medium"></textarea> 
	</div> 
	</li>
		
				<li class="buttons">
		    <input type="hidden" name="form_id" value="534695" />
		    
			<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
	</li>
		</ul>
	</form>	
	<div id="footer">
		
	</div>
</div>
<img id="bottom" src="bottom.png" alt="">
</body>
[/code]

ok, well it looks like just copied and pasted fields in there, so the first thing you’ll want to do is given each field a proper name so you know what data you’re dealing with, unless you can keep it straight. I won’t go into detail because there are litterly tons of tutorials on this topic, so here it goes.

1st, you’ll need a database and tables. How many tables depends entirely on what you’re storing and how organized you things to be.

2nd, once you have the user info, you’ll need to code a simple connection script to to included in your main file.

3rd, to pull information from a form after submission (and assuming you’re using POST as the method), it would be something like $name = $_POST[‘element_1_2’];

4th, to add a bit of security against baddies, use mysql_real_string_escape($_POST[‘element_1_2’]);

5th, once you have all your data setup and sanatized, you can do the query. Lots of tutorials on this, just search.

And that’s the basics. Before you do any inserts, you’ll want to do some simple validation, either with js or straight php.

Sponsor our Newsletter | Privacy Policy | Terms of Service