0

can anybody help with how to create login page with displaying username on the top of the page

4th Nov 2016, 11:24 AM
raman
raman - avatar
5 Answers
+ 1
do you want to dislpay username after user success login ? you can use session.. set and retrive your username session.
4th Nov 2016, 4:01 PM
ANSHAR FIRMAN
ANSHAR FIRMAN - avatar
+ 1
I think this works , try to understand each step <!Doctype html> <html> <body> <p id="3"></p> <input type="text" placeholder="Enter Username" name="username" id="1" /><br>. //id is important here <input type="password" placeholder="Enter Password " name="Password" id="2" /><br> <button type="button" onclick="login( ) " > Submit </button> /*onclick event is imp as ,on clicking the submit button it excecutes login function*/ <script> Function login( ) { a= document.getElementById("1").value; /*document.getElementById("1").value; is getting value we entered in username input */ b= document.getElementById("2").value; document.getElementById("3").innerHTML="Welcome &nbsp" + a; /* innerHTML modifies or adds out output to html element (here element is paragraph */ } </script> </body> </html> Hope this one solves ur problem,happy coding
4th Nov 2016, 5:28 PM
Manoj Kiran
Manoj Kiran - avatar
0
i have created a website there am using popup for login and by loging in i want username should be displayed. .i dnt know about session can u plz send me the coding anshar firman:)
5th Nov 2016, 7:32 AM
raman
raman - avatar
0
no this coding doesnot show any result i tried
5th Nov 2016, 7:33 AM
raman
raman - avatar
0
Atleast it's working for me & don't know about session ,lets see if anyone prints code
5th Nov 2016, 7:37 AM
Manoj Kiran
Manoj Kiran - avatar