Hi,
I am just getting trouble in a form submission. I have two input box with values and after each one it has two submit button.
When i want to update it gives me the same value for all input boox. Check this code..
I m gettin same value when i click on update for any input box.
<?php
function index() {
echo"<form action=check.php?op=update method=post>"
."Value 1<input type=text name=val1 value=.30> Value2 <input type=text name=val2 value=40><input type=submit value=Update name=update><input type=submit value=Delete name=del><br>"
."Value 1<input type=text name=val1 value=.30> Value2 <input type=text name=val2 value=50><input type=submit value=Update name=update><input type=submit value=Delete name=del><br>"
."Value 1<input type=text name=val1 value=.30> Value2 <input type=text name=val2 value=40><input type=submit value=Update name=update><input type=submit value=Delete name=del><br>"
."</form>";
}
function update() {
if(isset($_POST[update])) {
echo"You want to update this values $_POST[val1] and $_POST[val2] ";
exit;
}
elseif(isset($_POST[del])) {
echo"You want to delete this values $_POST[val1] and $_POST[val2]";
exit;
}else {
echo"Invalid Command";
exit;
}
}
switch($_GET[op]) {
default:
index();
break;
case"update";
update();
break;
}
?>
I want somethig like this
form start
Input box1 valus 3,4 | update button,delete button
input box2 values 5,6 |update buton,delete button
input box3 values 7,8 |update button,delete button
form end
When i click on update button i always get 7,8
When i click on update button of input box2 i should get values 5,6
When i click on update button of input box1 i should get values 3,4