Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
User Login via Prompt Popup & Set / Get cookie JS not functioning
Old 12-09-2006, 02:07 AM User Login via Prompt Popup & Set / Get cookie JS not functioning
Junior Talker

Posts: 3
Trades: 0
use a popup / prompt requesting the visitor to enter a USERNAME so after the user clicks SUBMIT on the prompt all the pages in the site should greet the user with Hi, USERNAME.

But there are two problems.
1. From another page in the site, when I return to the HOME page, the prompt reappears even though I've already entered a USERNAME.

2. The other pages don't greet the user. The Hi, USERNAME doesn't appear.

Could someone offer some help with this?
I've been looking at the code too long to see where the mistake(s) are.
Thank you very much.
TokyoJ

The HOME page / default URL page has this:
<head>
<script language = "JavaScript">
<!--
function writeCookie()
{
var username = prompt("What's your name?", "");
var username = "username=";
document.cookie = username;
}
// -->
</script>
</head>


Then all other pages have this:
<head>
<title> Contact Details </title>
<script language="JavaScript" </script>
<script language="JavaScript" type="text/javascript">
if (GetCookie("username"))
{
write("Hi" + GetCookie("username"));
}
</script>
</head>
TokyoJ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to User Login via Prompt Popup & Set / Get cookie JS not functioning
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.82479 seconds with 12 queries