cbrams9
11 Sep 2006, 01:58 PM
Hi All,
Im just trying to do an Application Form on a site im doing, but need help!
Please could anyone help with the following -
Have the Application Form - submit into mysql database,
does javascript need to be used for the submit button also?
Have the Form - sent to an email address
Have Form - validation
Below is my form -
<br><b>Section 1</b>
<br>Details of person/people for whom help is being sought.<br>
</td>
</tr>
<form action="insert.php" method="post">
<tr>
<td>Name:</td>
<td><input name="name" type="text" size="100">
<br></td>
</tr>
<tr>
<td>Date of Birth: </td>
<td><input type="text" name="dob"><br></td>
</tr>
<tr>
<td>Address 1:</td>
<td><input type="text" name="a1"><br></td>
</tr>
<tr>
<td>Address 2:</td>
<td><input type="text" name="a2"><br></td>
</tr>
<tr>
<td>Postcode:</td>
<td><input type="text" name="psc"><br></td>
</tr>
<tr>
<td>Town/City:</td>
<td><input type="text" name="tc"><br></td>
</tr>
<tr>
<td>Phone: </td>
<td><input type="text" name="phone"><br></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email"><br></td>
</tr>
<tr>
<td>Type of request:</td>
<td><select name='typerequest'>
<option selected>Please Select
<option>Equipment for home
<option>Medical
<option>Transport
</select><br></td>
</tr>
<tr>
<td>Amount of grant required:</td>
<td><select name='grant'>
<option selected>Please Select
<option>Up to - £1000
<option>Up to - £3000
<option>Up to - £5000
</select><br></td>
</tr>
<tr>
<td>Brief outline of request:</td>
<td><textarea name="outlinerequest"></textarea><br></td>
</tr>
<tr>
<td>Details of request:</td>
<td><textarea name="detailsrequest"></textarea><br></td>
</tr>
</table>
<tr>
<td><br><b>Section 2</b><br>Relationship to person/people above
<select name='relate'>
<option selected>Please Select
<option>Parent
<option>Friend
<option>Therapist
<option>Representative of institution
<option>Other
</select><br></td>
</tr>
<tr>
<table width="100%" height="270" border="0">
<tr>
<td><br>Name:</td>
<td><input type="text" name="name2"><br></td>
</tr>
<tr>
<td>Address 1:</td>
<td><input type="text" name="a12"><br></td>
</tr>
<tr>
<td>Address 2:</td>
<td><input type="text" name="a22"><br></td>
</tr>
<tr>
<td>Postcode:</td>
<td><input type="text" name="psc2"><br></td>
</tr>
<tr>
<td>Town/City:</td>
<td><input type="text" name="tc2"><br></td>
</tr>
<tr>
<td>Phone:</td>
<td><input type="text" name="phone2"><br></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email2"><br></td>
</tr>
<tr>
</form>
<tr>
<td>Submit</td>
</tr>
<tr>
<td>
If you have any questions regarding this form or it does not meet your needs, please
feel free to email <a href='mailto:brenda.yong@sfcharity.co.uk'>Brenda Yong</a>
</td>
</tr>
Php code so far -
<?php
$user="c";
$password="c";
$database="charity";
mysql_connect("localhost",$user,$password);
if(!mysql_select_db($database) )
echo mysql_error();
$query = "INSERT INTO contacts VALUES
mysql_query($query);
mysql_close();
echo "ok";
?>
Please can anyone help??
Thanks
Im just trying to do an Application Form on a site im doing, but need help!
Please could anyone help with the following -
Have the Application Form - submit into mysql database,
does javascript need to be used for the submit button also?
Have the Form - sent to an email address
Have Form - validation
Below is my form -
<br><b>Section 1</b>
<br>Details of person/people for whom help is being sought.<br>
</td>
</tr>
<form action="insert.php" method="post">
<tr>
<td>Name:</td>
<td><input name="name" type="text" size="100">
<br></td>
</tr>
<tr>
<td>Date of Birth: </td>
<td><input type="text" name="dob"><br></td>
</tr>
<tr>
<td>Address 1:</td>
<td><input type="text" name="a1"><br></td>
</tr>
<tr>
<td>Address 2:</td>
<td><input type="text" name="a2"><br></td>
</tr>
<tr>
<td>Postcode:</td>
<td><input type="text" name="psc"><br></td>
</tr>
<tr>
<td>Town/City:</td>
<td><input type="text" name="tc"><br></td>
</tr>
<tr>
<td>Phone: </td>
<td><input type="text" name="phone"><br></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email"><br></td>
</tr>
<tr>
<td>Type of request:</td>
<td><select name='typerequest'>
<option selected>Please Select
<option>Equipment for home
<option>Medical
<option>Transport
</select><br></td>
</tr>
<tr>
<td>Amount of grant required:</td>
<td><select name='grant'>
<option selected>Please Select
<option>Up to - £1000
<option>Up to - £3000
<option>Up to - £5000
</select><br></td>
</tr>
<tr>
<td>Brief outline of request:</td>
<td><textarea name="outlinerequest"></textarea><br></td>
</tr>
<tr>
<td>Details of request:</td>
<td><textarea name="detailsrequest"></textarea><br></td>
</tr>
</table>
<tr>
<td><br><b>Section 2</b><br>Relationship to person/people above
<select name='relate'>
<option selected>Please Select
<option>Parent
<option>Friend
<option>Therapist
<option>Representative of institution
<option>Other
</select><br></td>
</tr>
<tr>
<table width="100%" height="270" border="0">
<tr>
<td><br>Name:</td>
<td><input type="text" name="name2"><br></td>
</tr>
<tr>
<td>Address 1:</td>
<td><input type="text" name="a12"><br></td>
</tr>
<tr>
<td>Address 2:</td>
<td><input type="text" name="a22"><br></td>
</tr>
<tr>
<td>Postcode:</td>
<td><input type="text" name="psc2"><br></td>
</tr>
<tr>
<td>Town/City:</td>
<td><input type="text" name="tc2"><br></td>
</tr>
<tr>
<td>Phone:</td>
<td><input type="text" name="phone2"><br></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email2"><br></td>
</tr>
<tr>
</form>
<tr>
<td>Submit</td>
</tr>
<tr>
<td>
If you have any questions regarding this form or it does not meet your needs, please
feel free to email <a href='mailto:brenda.yong@sfcharity.co.uk'>Brenda Yong</a>
</td>
</tr>
Php code so far -
<?php
$user="c";
$password="c";
$database="charity";
mysql_connect("localhost",$user,$password);
if(!mysql_select_db($database) )
echo mysql_error();
$query = "INSERT INTO contacts VALUES
mysql_query($query);
mysql_close();
echo "ok";
?>
Please can anyone help??
Thanks