Jump to content

[SOLVED] help with an IF


dadamssg

Recommended Posts

im creating a delete post script...and i want to determine if the person that is trying to delete the post is the same as the person who created it....if they do match ==> delete else ==> send to homepage

 

if($row['createdby'] !== $_SESSION['logname'])
{
$sql = "DELETE FROM test WHERE eventid={$postid}";
$result = mysqli_query($cxn,$sql)
            or die (mysqli_error($cxn));
}
else
{
header("location: project12.php");
}

 

i echo'd $row['createdby'] and $_SESSION['logname'] and they output correctly

but i can still delete if im not logged in as the person who created it.

any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/152621-solved-help-with-an-if/
Share on other sites

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.