Hi, this is my problem. I have two php files such as a.php, b.php
a.php :
<?php
require("b.php" );
if($_GET['submit'] == "")
{
MainFrame();
}
else if ($_GET['submit'] == "Receiving" )
{
Receiving();
}
else {
foo1();
}
?>
b.php :
<?php
function MainFrame()
{
........many choices , one of them is "Receiving"
}
function Receiving()
{<form action = \"Receiving.php \" method=\"GET\">
............... .
<td><select name =\"Receiving_Re ceivedBy\">");
while($Row = mysql_fetch_arr ay($Result)){
print("<option value =\"$Row[EmployeeID]\">$Row[Employee_Name]
</option>");
}
print(" </select></td></tr>
<input type =\"button\" name=\"Change_P art\" value=\"Add\">
<input type =\"button\" name=\"Change_P art1\" value=\"Edit\">
............... ............... .
............... ....
<input type =\"submit\" name=\"Receivin g_submit\"
value=\"Submit\ ">
</form>
}
?>
What i want:
after i click the button and its value is Add , do Add function to add
the employee in the database
after I click the button and its value is edit , do Edit function to
edit the information in particular employee.
Finally, i get all information and click the submit to save the data
in the database. However, i dont know how can i check the button is
clicked. Do i need to write javascript. Coz i am not familiar with
javascript. Do i have other method? i know i cannot use type=submit
again coz form cannot nest.
Thanks
Krista
a.php :
<?php
require("b.php" );
if($_GET['submit'] == "")
{
MainFrame();
}
else if ($_GET['submit'] == "Receiving" )
{
Receiving();
}
else {
foo1();
}
?>
b.php :
<?php
function MainFrame()
{
........many choices , one of them is "Receiving"
}
function Receiving()
{<form action = \"Receiving.php \" method=\"GET\">
............... .
<td><select name =\"Receiving_Re ceivedBy\">");
while($Row = mysql_fetch_arr ay($Result)){
print("<option value =\"$Row[EmployeeID]\">$Row[Employee_Name]
</option>");
}
print(" </select></td></tr>
<input type =\"button\" name=\"Change_P art\" value=\"Add\">
<input type =\"button\" name=\"Change_P art1\" value=\"Edit\">
............... ............... .
............... ....
<input type =\"submit\" name=\"Receivin g_submit\"
value=\"Submit\ ">
</form>
}
?>
What i want:
after i click the button and its value is Add , do Add function to add
the employee in the database
after I click the button and its value is edit , do Edit function to
edit the information in particular employee.
Finally, i get all information and click the submit to save the data
in the database. However, i dont know how can i check the button is
clicked. Do i need to write javascript. Coz i am not familiar with
javascript. Do i have other method? i know i cannot use type=submit
again coz form cannot nest.
Thanks
Krista
Comment