mardi 22 septembre 2015

Echo a form and an input with PHP

It's my first question here and I hope I can get some help.

The code should display the comments present in the database and add an EDIT button if the user that is logged in is the same as the author of the comment.

This is the part of the code that is causing problems.

 if($_SESSION['login_user'] == $row["user"]) 
{
    echo"<form action ='editform.php' method='POST'>";
    echo "<input type='hidden' name='id' value= '". $row["id"] ."'/>";
    echo "". $row["user"] . "". "<br>" . $row["messaggio"] . "<br>". "";
    echo "<input name='submit' type='submit'  value='edit'>". "<hr>";
    echo "</form>";
}

I can not figure out what I am doing wrong. Only the comments and the user are displayed, and no Edit button.

Any idea on what I am doing wrong?




Aucun commentaire:

Enregistrer un commentaire