Jump to content

how to allow the user not another user edit there profile?


rallokkcaz

Recommended Posts

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 database

if($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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.