On my home page I have a login form. Can it be changed to something else based on the the username that has been logged in?
For example
<form id="form1" name="form1" method="post" action="testconnect.php">
<p>
<label for="username">Username:</label>
<input type="text" name="username" id="username" />
</p>
<p>
<label for="password">Password:</label>
<input type="text" name="password" id="password" />
</p>
<p>
<input type="submit" name="login" id="login" value="Submit" />
</p>
</form>
Can this be changed on the homepage to show
Welcome Back “Username”. Logout
So, if I understand correctly you want to hide the form if the user is already logged in and display their username in a message instead? Yes, you can do that. If you are using PHP sessions to store the user data, you could do something like this: