dadamssg Posted April 5, 2009 Share Posted April 5, 2009 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 More sharing options...
dadamssg Posted April 5, 2009 Author Share Posted April 5, 2009 im an idiot forgot to take off the '!' in there...sorry for wasting peoples time :-\ Link to comment https://forums.phpfreaks.com/topic/152621-solved-help-with-an-if/#findComment-801551 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.