this is what i want to do. when you select one from the list. it should save to that table.
like im planing to create Student table + Lectuerer table
so when the user select Student in combobox . and then fill the form and submit it should goes to that table.
how to do it
how to check selectediteme in combo box
Page 1 of 14 Replies - 2429 Views - Last Post: 27 May 2009 - 05:40 PM
Replies To: how to check selectediteme in combo box
#2
Re: how to check selectediteme in combo box
Posted 22 May 2009 - 11:41 PM
no help :S
#3
Re: how to check selectediteme in combo box
Posted 23 May 2009 - 12:10 AM
k here what is needed first you create your main page and one combo box and add Students and Lecturer such as
and then a receive.php page and type the following code
~Noor Ahmad~
<form id="form1" name="form1" method="post" action="">
<label>
<select name="select" id="select">
<option value="Student">Student</option>
<option value="Lecturer">Lecturer</option>
</select>
</label>
<br />
<br />
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5">Table</td>
</tr>
</table>
<p>
<label>
<input type="submit" name="button" id="button" value="Submit" />
</label>
</p>
<p> </p>
</form>and then a receive.php page and type the following code
<?php
<?php
if(isset($_POST['select']))
{
$page = $_POST['select'];
if($page=="Student")
{
//Insert into Student Table
}
else
{
// Insert into Lecturer Table
}
}
?>
~Noor Ahmad~
#4
Re: how to check selectediteme in combo box
Posted 23 May 2009 - 07:48 PM
#5
Re: how to check selectediteme in combo box
Posted 27 May 2009 - 05:40 PM
or you can use this script
and in receive.php
<select name="type_user" onchange="window.open('receive.php?type_user='+this.value,'_top');">
<option value="1">Student</option>
<option value="2">Lecturer</option>
</select>
and in receive.php
<?
$type_user = $_POST['type_user'];
switch($type_user)
{ case 1;
{ //Insert into Student Table } break;
case 2;
{ // Insert into Lecturer Table } break;
}
?>
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|