rallokkcaz Posted September 3, 2006 Share Posted September 3, 2006 i wanna to allow only the user who's infois on the page to edit itexample user1 can edit there profileand user2 can't how could i make a code to do that Quote Link to comment Share on other sites More sharing options...
SharkBait Posted September 3, 2006 Share Posted September 3, 2006 If the user is logged in, check to make sure that the user who is currently logged in matches that of the profile.IE[code]<?php$USERNAME = "SharkBait";$USER = "SharkBait"; // Retrieved from a databaseif($USERNAME == $USER) { // Allow user to edit profile} else { // User is not allowed to edit profile echo "<p>You are unauthorized to do that action.</p>\n";}?>[/code] Quote Link to comment 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.