My code is supposed to add, update and delete users by admin or other power users.
The admin/pu login to the admin page list all users and take action (delete|edit).
Each time I click on edit or delete a user I get the data of the logged in user and not the user I want to edit or delete, I think this is because the cookie is storing the id for the logged user so each time I move to the edit page I take this id with me. I tried to pass the username as a unique id through hidden in order to be able to take action but it didnt work.
Could you please help me with that? What is a good practice to accomplish this without problem?
Thx
Following are portions of code for moving values between pages:
print "<td align='center' width=\"5%\"><a href='editbyn.php?username=$username'>Edit</a>";
<?php if (!isset($_COOKIE['id'])){
$url = "nlogin.php";
header("Location: $url");
exit();
}
include ('./include/header.html');?>
<?php include_once("include/db_connection.php");
?>
<?php
$id = $_POST['id'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];