I have a session running by the following code:
<?php
session_start();
if (!isset($_SESSION['first_name'])) {
$path_to_login = "http://www.xxxxxxxxx.net/login.php";
header("Location: ".$path_to_login);
}
?>
Later on in the page I have a form setup for the person that is logged on to edit their bio, but I want make it secure that they can edit theirs, and only their, bio's.
The query I tried was:
$query = "SELECT * FROM users WHERE userid = '. $_SESSION['userid']'";
Is there a way I can change that so it will get * FROM users where the userid is the userid from the session?