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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Simple login/pw redirect please help

    I want to add to a website the feature that a client can access a particular page for ex. They would enter their job i.d. number and be redirected to their job. If they're job I.D. number is 1776 then the page it would redirect to would be 1776.html -- Sounds simple enough but I cant find a script that'll do this. Any help would be greatly appreciated. Thanks!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You do know that with javascript anyone who enters the correct id would be taken to the page they entered?

  • #3
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    No I didnt, are you telling me that by entering the page file name (ex. 1776) they would be redirected to 1776.html? Because thats exactly what Im looking for. | Novice at Java

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Yes that is what I'm telling you but anyone would be able to view it. Note java is not javascript.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title></title>
    <script type="text/javascript">
    function goTo(){
    var thego=document.forms[0].thego.value;
    window.location='http://www.yoursite.com/'+thego+'.html';
    return false;
    }
    </script>
    </head>
    
    <body>
    <form action="#" onsubmit="return goTo()" method="post">
    <input type="text" name="thego">
    <input type="submit" value="Go">
    </form>
    </body>
    </html>


  •  

    Posting Permissions

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