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 Link to comment https://forums.phpfreaks.com/topic/19547-how-to-allow-the-user-not-another-user-edit-there-profile/ 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] Link to comment https://forums.phpfreaks.com/topic/19547-how-to-allow-the-user-not-another-user-edit-there-profile/#findComment-85030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.