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 Quote 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!) Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/65048-php-case-switch-help/#findComment-324673 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.