Hi all,
I am a newbie in php. I have met a problem in echoing a few submit buttons using while loop. How do i differentiate which submit button is being click in order to grab the correct data. Below are a part of my codes:
[code=php]
while($requestM atch = mysql_fetch_arr ay($friendReque st)){
echo "<table width=425 height=130 border=0>";
echo "<tr>";
echo "<td width=110 class=style2>Ad d as Friend?? : </td>";
echo "<td width=55 align=left valign=middle>" ;
echo "<p>";
echo "<form action='".$_SER VER['PHP_SELF'.'QUE RY_STRING']."' method='post'>" ;
echo "<a href='newFriend Request.php?tes t="; echo $_SESSION['reqFriendEmail ']; echo "'><input name=Submit type=submit value=YES style='width: 30px; height: 14px; font-family: Lucida Sans; font-size: 9px; color:#FFFFFF; background:#FF4 700; font-style: normal; font-weight: normal; border:1px #FFFFFF; display: block; cursor:pointer; text-align: center;>";
echo "</form></p></td>";
echo "</tr>";
echo "</table>";
echo "<br>";
$_SESSION['reqFriendName'] = $requestMatch['username'];
$_SESSION['reqFriendEmail '] = $requestEmail;
}
Note: i am doing a friend request page. The situation is when the user receives two requests and when the user click one of the "Yes" submit button. It takes the last request out of the friends request.
[/code]
I am a newbie in php. I have met a problem in echoing a few submit buttons using while loop. How do i differentiate which submit button is being click in order to grab the correct data. Below are a part of my codes:
[code=php]
while($requestM atch = mysql_fetch_arr ay($friendReque st)){
echo "<table width=425 height=130 border=0>";
echo "<tr>";
echo "<td width=110 class=style2>Ad d as Friend?? : </td>";
echo "<td width=55 align=left valign=middle>" ;
echo "<p>";
echo "<form action='".$_SER VER['PHP_SELF'.'QUE RY_STRING']."' method='post'>" ;
echo "<a href='newFriend Request.php?tes t="; echo $_SESSION['reqFriendEmail ']; echo "'><input name=Submit type=submit value=YES style='width: 30px; height: 14px; font-family: Lucida Sans; font-size: 9px; color:#FFFFFF; background:#FF4 700; font-style: normal; font-weight: normal; border:1px #FFFFFF; display: block; cursor:pointer; text-align: center;>";
echo "</form></p></td>";
echo "</tr>";
echo "</table>";
echo "<br>";
$_SESSION['reqFriendName'] = $requestMatch['username'];
$_SESSION['reqFriendEmail '] = $requestEmail;
}
Note: i am doing a friend request page. The situation is when the user receives two requests and when the user click one of the "Yes" submit button. It takes the last request out of the friends request.
[/code]
Comment