So I have to make this fake form for uni SA. It needs to call a php file that sends all the information as a comma delimited file so that it can be read by a database program such as Microsoft Excel.
This is the html I've got so far:
I don't think it needs to be any better than the most basic of basic coding, meaning it doesn't need to be able to tell if everything has been filled out correctly or display any messages, but I suppose doing so would be extra credit.
Is the php as simple as this?:
Do I put a $_REQUEST thingy for every part of the form? Is it the same code for the radio buttons and did I do the buttons correctly? How exactly do you make it "comma delimited"?
Thanks in advance.
This is the html I've got so far:
<!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>Untitled Document</title>
</head>
<body>
<p><img src="unisa.jpg" width="709" height="607" alt="unisa" /></p>
<hr />
<form id="form1" name="form1" method="post" action="form.php">
<table width="500" border="0">
<tr>
<td>YOUR NAME*:</td>
<td> </td>
</tr>
<tr>
<td>Family Name (as it appears on your last degree):</td>
<td><input type="text" name="Fname" id="Fname" tabindex=1/></td>
</tr>
<tr>
<td>Given Names(s):</td>
<td><input type="text" name="Gname" id="Gname" tabindex=2/></td>
</tr>
<tr>
<td><label for="gender">Male/Female:</label></td>
<td>Male:
<input type="radio" name="radio" id="gender" value="male" tabindex=3/>
Female:
<input type="radio" name="radio" id="gender" value="female" tabindex=4/></td>
</tr>
<tr>
<td>YOUR FULL ADDRESS*:</td>
<td> </td>
</tr>
<tr>
<td>Street:</td>
<td><input type="text" name="street" id="street" tabindex=5/></td>
</tr>
<tr>
<td>City:</td>
<td><input type="text" name="city" id="city" tabindex=6/></td>
</tr>
<tr>
<td>Country:</td>
<td><input type="text" name="country" id="country" tabindex=7/></td>
</tr>
<tr>
<td>Zip Code:</td>
<td><input type="text" name="zipcode" id="zipcode" tabindex=8/></td>
</tr>
<tr>
<td>Phone*:</td>
<td> </td>
</tr>
<tr>
<td>Country Code:</td>
<td><input type="text" name="pcountrycode" id="pcountrycode" tabindex=9/></td>
</tr>
<tr>
<td>Area Code:</td>
<td><input type="text" name="pareacode" id="pareacode" tabindex=10/></td>
</tr>
<tr>
<td>Number:</td>
<td><input type="text" name="pnumber" id="pnumber" tabindex=11/></td>
</tr>
<tr>
<td>FAX*:</td>
<td> </td>
</tr>
<tr>
<td>Country Code:</td>
<td><input type="text" name="fcountrycode" id="fcountrycode" tabindex=12/></td>
</tr>
<tr>
<td>Area Code:</td>
<td><input type="text" name="fareacode" id="fareacode" tabindex=13/></td>
</tr>
<tr>
<td>Number:</td>
<td><input type="text" name="fnumber" id="fnumber" tabindex=14/></td>
</tr>
<tr>
<td>Email* (private for all correspondence):</td>
<td><input type="text" name="email" id="email" tabindex=15/></td>
</tr>
<tr>
<td>CURRENT QUALIFICATIONS* (list all awards & degrees obtained and any current studies in order of date conferred):</td>
<td> </td>
</tr>
<tr>
<td>Award/Degree:</td>
<td><input type="text" name="cdegree" id="cdegree" tabindex=16/></td>
</tr>
<tr>
<td>Institution:</td>
<td><input type="text" name="cinstitution" id="cinstitution" tabindex=17/></td>
</tr>
<tr>
<td>Year Conferred:</td>
<td><input type="text" name="cyear" id="cyear" tabindex=18/></td>
</tr>
<tr>
<td>NEEDED QUALIFICATIONS (list all awards & degrees you want help with):</td>
<td> </td>
</tr>
<tr>
<td>Award/Degree:</td>
<td><input type="text" name="ndegree" id="ndegree" tabindex=19/></td>
</tr>
<tr>
<td>Institution:</td>
<td><input type="text" name="ninstitution" id="ninstitution" tabindex=20/></td>
</tr>
<tr>
<td>Year:</td>
<td><input type="text" name="nyear" id="nyear" tabindex=21/></td>
</tr>
</table>
Comments (100 words) on WHY you need to study for this award:
<br>
<textarea name="comments" id="comments" cols="45" rows="5" tabindex=22></textarea>
</br>
<br>
<input type="submit" name="submit" id="submit" value="Send it!" tabindex=23/>
</br>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<p><img src="unisa.jpg" width="709" height="607" alt="unisa" /></p>
<hr />
<form id="form1" name="form1" method="post" action="form.php">
<table width="500" border="0">
<tr>
<td>YOUR NAME*:</td>
<td> </td>
</tr>
<tr>
<td>Family Name (as it appears on your last degree):</td>
<td><input type="text" name="Fname" id="Fname" tabindex=1/></td>
</tr>
<tr>
<td>Given Names(s):</td>
<td><input type="text" name="Gname" id="Gname" tabindex=2/></td>
</tr>
<tr>
<td><label for="gender">Male/Female:</label></td>
<td>Male:
<input type="radio" name="radio" id="gender" value="male" tabindex=3/>
Female:
<input type="radio" name="radio" id="gender" value="female" tabindex=4/></td>
</tr>
<tr>
<td>YOUR FULL ADDRESS*:</td>
<td> </td>
</tr>
<tr>
<td>Street:</td>
<td><input type="text" name="street" id="street" tabindex=5/></td>
</tr>
<tr>
<td>City:</td>
<td><input type="text" name="city" id="city" tabindex=6/></td>
</tr>
<tr>
<td>Country:</td>
<td><input type="text" name="country" id="country" tabindex=7/></td>
</tr>
<tr>
<td>Zip Code:</td>
<td><input type="text" name="zipcode" id="zipcode" tabindex=8/></td>
</tr>
<tr>
<td>Phone*:</td>
<td> </td>
</tr>
<tr>
<td>Country Code:</td>
<td><input type="text" name="pcountrycode" id="pcountrycode" tabindex=9/></td>
</tr>
<tr>
<td>Area Code:</td>
<td><input type="text" name="pareacode" id="pareacode" tabindex=10/></td>
</tr>
<tr>
<td>Number:</td>
<td><input type="text" name="pnumber" id="pnumber" tabindex=11/></td>
</tr>
<tr>
<td>FAX*:</td>
<td> </td>
</tr>
<tr>
<td>Country Code:</td>
<td><input type="text" name="fcountrycode" id="fcountrycode" tabindex=12/></td>
</tr>
<tr>
<td>Area Code:</td>
<td><input type="text" name="fareacode" id="fareacode" tabindex=13/></td>
</tr>
<tr>
<td>Number:</td>
<td><input type="text" name="fnumber" id="fnumber" tabindex=14/></td>
</tr>
<tr>
<td>Email* (private for all correspondence):</td>
<td><input type="text" name="email" id="email" tabindex=15/></td>
</tr>
<tr>
<td>CURRENT QUALIFICATIONS* (list all awards & degrees obtained and any current studies in order of date conferred):</td>
<td> </td>
</tr>
<tr>
<td>Award/Degree:</td>
<td><input type="text" name="cdegree" id="cdegree" tabindex=16/></td>
</tr>
<tr>
<td>Institution:</td>
<td><input type="text" name="cinstitution" id="cinstitution" tabindex=17/></td>
</tr>
<tr>
<td>Year Conferred:</td>
<td><input type="text" name="cyear" id="cyear" tabindex=18/></td>
</tr>
<tr>
<td>NEEDED QUALIFICATIONS (list all awards & degrees you want help with):</td>
<td> </td>
</tr>
<tr>
<td>Award/Degree:</td>
<td><input type="text" name="ndegree" id="ndegree" tabindex=19/></td>
</tr>
<tr>
<td>Institution:</td>
<td><input type="text" name="ninstitution" id="ninstitution" tabindex=20/></td>
</tr>
<tr>
<td>Year:</td>
<td><input type="text" name="nyear" id="nyear" tabindex=21/></td>
</tr>
</table>
Comments (100 words) on WHY you need to study for this award:
<br>
<textarea name="comments" id="comments" cols="45" rows="5" tabindex=22></textarea>
</br>
<br>
<input type="submit" name="submit" id="submit" value="Send it!" tabindex=23/>
</br>
</form>
</body>
</html>
Is the php as simple as this?:
<?php
$email = $_REQUEST['email'] ;
$comments = $_REQUEST['comments'] ;
mail( "fe[email protected]", "Uni Degree Qualifications",
$message, "From: $email" );
?>
$email = $_REQUEST['email'] ;
$comments = $_REQUEST['comments'] ;
mail( "fe[email protected]", "Uni Degree Qualifications",
$message, "From: $email" );
?>
Thanks in advance.
Comment