|
So what I want to do is when user is logged in(using sessionsstart) then the spot where it used to say Enter username and password will be replaced with welcome name_of_user
The problem is that the code for getting user to enter username and password is in html format like this
<form action="verification.php" method="post">
<table>
<tr>
<th colspan="2"
bgcolor="gray">
<font color="white">
Sign in
</font>
</th>
</tr>
<tr>
<td bgcolor="silver">
Username:
</td>
<td bgcolor="silver">
<input name="username" type="text"/>
</td>
</tr>
<tr>
<td bgcolor="silver">
Password:
</td>
<td bgcolor="silver">
<input name="password" type="password"/>
</td>
</tr>
</table>
<input type="submit" value="Submit"/>
</form>
And checking if user is currently logged in is this
<?php
session_start();
if (!(isset($_SESSION['login']) && $_SESSION['login'] != ''))
{
Show message saying welcome
}
else
{
Show the enter username and password code I posted above
}
?>
So is there any way I can take the form I made and show it into the else block of code so that it actually works, as far as I know I have no idea how to execute html code inside php block
|