Hi
I am a bit stuck on how to close a security issue.
Basically if someone is looking at their profile and wants to edit it the URL will show the id of the user.
Currently anyone can just change that number and have access to viewing and changing another persons profile.
I have tried the following code but what this is currently doing taking the user directly to the home page, but not actually allowng them to view or edit their own profile either.
<?php
// show if URL parameter != session variable
if (@$_GET['ID'] != (@$_SESSION['ID'])) {
?>
<meta http-equiv="Refresh" content="0; URL=http://xxxxxxxxx.com/index.php?user_id=<?php echo $_SESSION['ID']; ?>&id=<?php echo $_GET['ID']; ?>" />
<?php
}
C<?php
// show if URL parameter != session variable
if (@$_GET['ID'] != (@$_SESSION['ID'])) {
?>
<meta http-equiv="Refresh" content="0; URL=http://xxxxxxxxx.com/index.php?user_id=<?php echo $_SESSION['ID']; ?>&id=<?php echo $_GET['ID']; ?>" />
<?php
}
If anyone has any ideas about how to stop this kind of injection attack that would be great.
Many thanks
// end if
?>