Ok im fairly new to PHP. I have written a logon script and center so that the admin of my site can be done on-line. This is done using databases, MySQL, etc, etc.
All of my coding works fine on my local machine (running IIS, APACHE, PHP + MYSQL). After uploading it to my server I have the following problem. When I assign a sessioin vair to something the session vair also gets assigned what it is assigned to. That sounds weird so i will show the problem.
After validation these session vairs are set
$SESSION['id']
$SESSION['user']
$_SESSION['userlevel']
The next page requires the user's id, which is stored in $_SESSION['id'] to display their details. However the user can also change the vairiable $id in a text box so they can see other user's details as long as they have the correct userlevel, so:
<?php
$id = $_SESSION['id'];
if ($_SESSION['userlevel'] > 2){
$id = $_POST['id'];
echo "<form method=post action='details.php'>Select a user to user id: <input style='text' name='id' size=1 value='$id' > <button type=submit>Edit</button></form>";
}
?>
The page then goes on to display the rest of the details. My problem that the $id = $POST['id'] line seems to also do $SESSION['id'] = $_POST['id']. This of course leads to big problems!!
Please help
Lucas