User name to appear on all of my webpages

admin

Administrator
Staff member
Hello i am kinda new to this whole javascript, and i have a question for anyone: i put a some javascript code on my webpage, so that before my first page opens up you get a popup box saying Please enter name: after they enter their name, the page loads and they see their name on my webpage....

my question is there any script out there to have the peoples name automatically show up on all of my other pages after they sign in just once.......

i dont want them to keep on getting the popup box saying enter name: when they enter the different pages on my site???

please any help will be greatly appreciated
thanks:)

here is the code i used:

<script>

var whatName=prompt("Please type in your name:","");
function doName(theName){
if ((whatName != "")&&(whatName !=null)){
// you can modify this as needed
// this is the message if a name is typed in
document.writeln("Hello "+whatName+"!")
}else{
// you can modify this as needed
// this is the message if a name is *not* typed in
document.writeln("Hello Guest!")
}
}

doName(whatName);

</script>
 
Back
Top