I want to have a button, that logs out the user on click.
But I don’t feel like creating a form for that, or making an “onclick” handler.
Is there another way to do it?
<p class='loginposition normal'>
."$_SESSION['email']".<form action='/logout.php' method='post'><input class='logout-submit button' type='submit' style='float:right;' id='logoutbtn' value='Log Out'></form>
</p>";
I want them to be in one raw:
user@user.com [Log Out]
If you want a POST request then you need either Ajax (which would be a silly technique to use for logging out) or a form.
Since logging out is not a repeatable action, POST is the correct tool to do it.
Get over your feelings and use a form.
You can deal with the twin problems of your HTML being invalid and additional line breaks by putting the paragraph inside the form instead of the other way around.