PHP and form action on 1 line
I had just asked how to get two 2 form actions on 1 line and someone answered that, but now I want a small line of PHP to be on the same line.
Here's what I have so far:
PHP
if ($_SESSION['username'] )
echo "welcome, ".$_SESSION['username'];
HTML
<span style="float:right;">
<form action='logout.php' method='POST'>
<input type='submit' value='Logout' />
</form>
</span>
<span style="float:right;">
<form action='changepassword.php' method='POST'>
<input type='submit' value='Change password' />
</form>
</span>
You can view the irritation on my website: www.roundaboutmk.com.
You wi开发者_StackOverflow社区ll need to login to see the problem:
- username:
stackoverflow
- password:
test01
so you want the php echo also in a span with float right??
just place it before the two buttons
if ($_SESSION['username'] )
echo "<span style='float:right'>Welcome, ".$_SESSION['username']."</span>";
精彩评论