Hi there i m having some problems in creating and handling multiple buttons. The idea is that i have two buttons "Accept" and "Reject" and i want to give them differnt names using the variable $i from the for loop. Below i give you the code which shows what i am trying to do. The code has wrong syntax on purpose, in order to depict what i am trying to do!!
for ($i = 0; $i < count_req($getuser[0]['email']); $i++){
echo $req_array[$i]['s_fname']." ".$req_array[$i]['s_lname'];
echo "<form><input type='submit$i' name='accept' value='Accept'>
<input type='submit' name='reject$i' value='Reject'><br></form>";
echo "Request".count($_REQUEST);
if($_REQUEST['accept$i'] == 'Accept')
{
echo "Accept";
accept($getuser[0]['email'],$req_array[$i]['s_email']);
}
else if($_REQUEST['reject$i'] == 'Reject')
{
echo "Reject";
reject($getuser[0]['email'],$req_array[$i]['s_email']);
}
}
I just put $i to the name of the button and in the if statement. I want each button to have it's own name, otherwise all the accept and reject buttons work simultaneously. I'm open to any suggestion. Thanks in advance....