Hi all,
Here i have a serious problem. I want to sought it out using PHP and MySQL only.
I have a form includes fields of customer id and Account type( stored in a jump menu and includes 6 different types of accounts)
<style type="text/css">
<!--
body,td,th {
font-size: 18px;
font-weight: bold;
}
-->
</style>
<p><img src="../images/mahapitiya 1.jpg" width="1024" height="139" /></p>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="submit" name="button" id="button" value="Logout" />
</label>
</form>
<p> </p>
<form action="" method="post" name="form2" id="form2"
onsubmit="return Validate();">
<fieldset>
<legend class="cap">Create an Account</legend>
<table width="75%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td> </td>
<td class="title02"> </td>
<td> </td>
<td> </td>
</tr>
<tr height="30">
<td width="10%"> </td>
<td width="25%" class="title02" align="left">Customer ID</td>
<td width="55%" class="attribute1" align="left"><input type="text" name="customer_id" class="attribute1" /></td>
<td width="10%"> </td>
</tr>
<tr height="30">
<td> </td>
<td width="25%" class="title02" align="left">Account Type</td>
<td width="55%" align="left" bgcolor="#FFFFFF" class="attribute1"><select name="account_type" id="jumpMenu" >
<option selected="selected"></option>
<option>Savings Investment</option>
<option>Shakthi</option>
<option>Surathal</option>
<option>Abhimani Plus</option>
<option>Yasasa Certificates</option>
<option>Fixed Deposits</option>
</select> </td>
<td width="10%"> </td>
</tr>
</table>
<p align="center"> </p>
<p align="center">
<input type="submit" onclick="return Validate();" name="submit" value="Submit" class="attribute1" />
<input type="reset" name="reset" value="Reset" class="attribute1" />
<label>
<input type="submit" name="button2" id="button2" value="Help" />
</label>
</p>
</fieldset>
</td>
<td width="5%"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="center"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><font color="red" size="1" ></font></td>
<td> </td>
</tr>
</table>
</form>
<p> </p>
<script language = "Javascript">
function Validate()
{
if (document.form2.customer_id.value == '')
{
alert('Please enter the valid customer id!');
return false;
}
else if ( document.form2.account_type.selectedIndex == '' )
{
alert ( "Please select an account type!." );
return false;
}
return true;
}
</script>
There are 6 different types of tables exist in my database representing 6 different types of accounts.Each and every table there is a field called "account number" which is auto incremented.When user clicks on submit button i want account number to be opened based on selected account type.
How this could be done?
Thanks,
Heshan.