Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    clicking transportation (passwords)

    I'm looking for a code that if they click on certain links on a page they will be transported to another page...(I have a ton of links on one page and I have a password system so if their name is sumthing the links take them to a different page)

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How does your password system work?

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    they type in a username and password which takes them to the page they wanted to go to...hard to explain

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So the username and password are available as GET variables? Or is the form POST? (i.e. does form create a query string?) Because javascript can't directly access POSTDATA. You would need something like PHP to do that. Or use cookies....

  • #5
    New Coder
    Join Date
    Aug 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    they're in get variables

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Great! Then lets do this:
    Code:
    <script>
    var qString = top.location.search;
    qString = unescape(qString.substring(1));
    var getVars = qString.split(/[\&]/);
    var pageVars = new Array();
    for (var j in getVars)
    	{
    	var temp = getVars[j].split(/[=]/);
    	pageVars[j] = temp[1];
    	}
    </script>
    Now you have an array, pageVars that holds the value of each of the get variables (in sequence of appearance). Do you think this will work for you?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •