its easy.. when you write out the article, add an if for the logged in userid and the article's owner ID values:
<?
session_start();
function create_image($img,$w,$h)
{
return '<img src="'.$img.'" width="'.$w.'" height="'.$h.'">';
}
function create_button($articleid)
{
return '<form name="form1" method="post" action="update.php">
<input name="article_id" type="hidden" value="'.$articleid.'">
<input type="submit" name="Submit" value="Update">
</form>';
}
include("connect.php");
$sql="SELECT * FROM articles ORDER BY date";
while($row=mysql_fetch_assoc($result))
{
print $row["article_text"]."<br>";
print create_image($row["article_image"],155,40)."<br>";
if($row["owner"] ==$_SESSION["user_id"])
print create_button($row["article_id"]) ."<br>";
}
?>
vividona;10891813 wrote:hi friends,
In my simple funny article script
the edit button of the article appear to all members and guests
I need it to appear just for the article writer