Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I'm creating a website and would like to display the current user like this:

Welcome (USERNAME)

The login form is login.html and the main form is main.html but I would like to get the entered username from the previous login form and display it on the main form. Please could anybody help.

What I have tried:

login.html:
<form class="box" action="main.html" method="post">
  <h1>Login</h1>
  <input type="text" name="" id="username" placeholder="Username">
  <input type="submit" name="" value="Login">
</form>


main.html:

<b><span id="username"></span></b>
Posted
Updated 6-Sep-21 16:27pm
v2

1 solution

You can use an echo...that will call the result from the db



Also look up php echo on the web...plenty of resources out there :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900