Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Location
    Nottingham
    Posts
    5,277
    Tokens
    75

    Latest Awards:

    Default Why wont this code work?

    Code:
    <SCRIPT language="JavaScript"><!--hidevar password;var pass1="password";password=prompt('Please enter the Password:');if (password==pass1)alert('Password correct please wait to be directed to the page.');else { window.location="<a href=
    "index.htm">";    }//--></SCRIPT>
    The enter password window doesn't pop up for some reason. and before you ask no thats not my real password
    VR|46

  2. #2
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    You have two parse errors.
    Error #1:
    Code:
    prompt('Please enter the Password:');
    If you don't want any default text to appear in your script you still need to keep the quotes (just don't put anything in them).
    Use this instead:
    Code:
    prompt('Please enter the Password:','');
    Error #2:
    Code:
    window.location="<a href="index.htm">";
    You don't need to make it a link, as its not a link.
    Use this instead:
    Code:
    window.location="index.htm";
    Edit: Also you'll want to space out the lines of code, because some statements are mixed with others (e.g. hide and var are on the same line). That is also stopping the script from working.

    I know this is slightly off topic, but that script isn't very secure.
    kinda quit.

  3. #3
    Join Date
    Nov 2004
    Location
    Daventry, Northants
    Posts
    1,510
    Tokens
    0

    Latest Awards:

    Default

    You really dont want to use that script
    It is so easy to get around,
    Use .htacess

  4. #4
    Join Date
    Jun 2005
    Location
    Nottingham
    Posts
    5,277
    Tokens
    75

    Latest Awards:

    Default

    Still wont work is it because im using freewebs?

    EDIT: someone do it for me please im tired night all.
    VR|46

  5. #5
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by DJ-Simpson
    Still wont work is it because im using freewebs?

    EDIT: someone do it for me please im tired night all.
    I did explain what was wrong with it, and how to fix it.
    Oh well, I'll fix it..

    Code:
    <SCRIPT language="JavaScript">
    <!--hide
    var password; var pass1="password";
    
    	password=prompt('Please enter the Password:','');
    
    
    		if (password==pass1)
    		alert('Password correct please wait to be directed to the page.');
    
    			else {
    			window.location="index.htm";
    			}
    //-->
    </SCRIPT>
    That might work, test it.
    kinda quit.

  6. #6
    Join Date
    Jun 2005
    Location
    Nottingham
    Posts
    5,277
    Tokens
    75

    Latest Awards:

    Default

    It works thanks alot i would rep but it wont do owt cuz people are mardy and bad repped me for reportin a signature.
    VR|46

Posting Permissions

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