Jump to content

Allow users to update only their own Entries


studgate

Recommended Posts

I have three forms in my database, when each form is

submitted the current username is automatically entered into the database,

and I want the user to be able to edit only their entries. Everybody

can view the entries but only them can update it.

How do I do that??

Thanks in advance guys

You could set a cookie at login like this:

 

$_POST['username'] = stripslashes($_POST['username']); 
$hour = time() + 7200; 
setcookie(ID_yoursitename, $_POST['username'], $hour,'/');

 

Then check to make sure it's there like this:

if(isset($_COOKIE['ID_yoursitename'])) {

do something

}

 

And you gotta do the cookie stuff before you output anything to the browser in your script.

 

 

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.