jas4 Posted August 15, 2007 Share Posted August 15, 2007 Hi, I'm implemening an update profile section on my site and I'd like to use switch/case method. e.g. page.com?update=success or page.com?update=failure, when I use the $_GET['update'] it works fine, however what of someone changes the url manually to .com?update=somethingelse ? How can I stop people getting access to other pages/cases manually thanks Link to comment https://forums.phpfreaks.com/topic/65048-php-case-switch-help/ Share on other sites More sharing options...
php_tom Posted August 15, 2007 Share Posted August 15, 2007 Just test like so: if($_GET['update'] == "success") // Do success stuff here. else // Assume it failed! Print error message or whatever. Or if you want to be funny: if($_GET['update'] == "success") // Do success stuff here. elseif($_GET['update'] == "failure") // It failed! Print error message or whatever. else echo "Stop hacking! Your IP ".$_SERVER['REMOTE_ADDR']." has been logged."; Hehehe... (1 @/\/\ teh 1337 hax0r!) Link to comment https://forums.phpfreaks.com/topic/65048-php-case-switch-help/#findComment-324611 Share on other sites More sharing options...
trq Posted August 15, 2007 Share Posted August 15, 2007 You need to use sessions to log users in. If the user is trying to update a record that does not belong to them, deny the update. Link to comment https://forums.phpfreaks.com/topic/65048-php-case-switch-help/#findComment-324673 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.