What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » javascript POST?

javascript POST?
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: javascript POST?
It still isn't exactly clear what you want to do. Explain in clear steps and give each page/link a name ;)

But IF I read you correctly then with GET-method this is very easy todo...

in the page A you have to make a script which:
1) Check for cookie
2) if exist then reload page with page C
3) if it doesn't exist, ask for name and reload with page B

C and B can be the same page actually if you check in that page if something is added to the URL.

Even more: A, B and C can be the same page if you use this structure:
1) load the page
2) check if a cookie exist
4) if it exist, read it/process it load the page further...
3) if not then ask for a name, create the cookie, and load the page further...

There is no need for a form if you do that. All this can be done in plain javascript (or convert everything to php if you like). In Javascript it would be something like this:
code:
<html>
  <head>
    <title>Main Page</title>
    <script language="JavaScript">
      // Get the users name from a cookie,
      // if it doesn't exist then ask for it and create the cookie.
      var username = unescape(document.cookie)
      username = username.split("=")
      if (username == "") {
        username = prompt("What is your name?","")
        var expiredate = new Date()
        expiredate.setMonth(expiredate.getMonth() + 1)
        document.cookie = "Name=" + username + ";expires=" + expiredate.toGMTString() + ";path=/"
      }
      //
      // put your processes here, the variable username will hold the value of the name.
      //
    </script>
  </head>

  <body>
    normal page
  </body>
</html>

not tested

This post was edited on 02-20-2004 at 02:22 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
02-20-2004 01:41 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
javascript POST? - by bach_m on 02-20-2004 at 03:02 AM
RE: javascript POST? - by WDZ on 02-20-2004 at 04:32 AM
RE: javascript POST? - by fluffy_lobster on 02-20-2004 at 09:31 AM
RE: javascript POST? - by CookieRevised on 02-20-2004 at 10:55 AM
RE: javascript POST? - by KeyStorm on 02-20-2004 at 11:57 AM
RE: javascript POST? - by bach_m on 02-20-2004 at 12:04 PM
RE: javascript POST? - by CookieRevised on 02-20-2004 at 01:41 PM
RE: javascript POST? - by KeyStorm on 02-20-2004 at 02:45 PM
RE: javascript POST? - by WDZ on 02-20-2004 at 03:39 PM
RE: javascript POST? - by KeyStorm on 02-20-2004 at 04:19 PM
RE: javascript POST? - by WDZ on 02-20-2004 at 05:10 PM
RE: javascript POST? - by KeyStorm on 02-20-2004 at 05:13 PM
RE: javascript POST? - by bach_m on 02-20-2004 at 08:21 PM
RE: javascript POST? - by CookieRevised on 02-20-2004 at 09:25 PM
RE: javascript POST? - by bach_m on 02-20-2004 at 11:20 PM
RE: javascript POST? - by CookieRevised on 02-21-2004 at 08:12 AM
RE: javascript POST? - by KeyStorm on 02-21-2004 at 12:33 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On