With the code below I printed out a friendshiprequest on someone's page, for example: friendrequests.php?user_id=4.
The problem: When I click on the 'accept' button I have to stay on that page, but the 'user_id=4' dissapears.
In the action tags of the form I typed $_SERVER['PHP_SELF'] and I also typed the url manually (to test), but that also didn't work.
foreach ($friendrequests as $request) {
echo "<div><p><a href='profile.php?user_id=".$request['friendship_applicant_id']."'><img src='uploads/" . $request['friendship_applicant_avatar'] . " " . " ' alt='' />" . $request['friendship_applicant_surname'] . " " . $request['friendship_applicant_name']. "</a> has send you a friend request" . "<form action='' type='post'><button type='submit' name=''>Accept</button><button type='submit' name='' >Decline</button></form></p></div>";
}
?>