Jump to content

How can I put my page under password?


Guest Nitrub

Recommended Posts

Guest Nitrub

I wrote a little code.

<html><head><title>Paroolikaitse!</title></head><body bgcolor=#dbdbdb><center><form>Kasutajanimi<br><input type="username" name="username"><br>Parool<br><input type="password" name="password"><br><br><input type="submit" value="Sisene"></form></center></body></html>

And the result was this: http://www.burtin.msn.ee/parool.JPGNow I want to do so, that i enter correct username and password and then it directs it to ma website (homepage: http://www.burtin.msn.ee). The problem is that I can't manage that.Is somebody so helpful and helps me or gives me a website, where I can learn that.

Link to comment
Share on other sites

Find out what server side language your host supports, probs either PHP or ASP.Then check out the relevant tutorial for that language, specifically form handling.for PHP: http://www.w3schools.com/php/php_forms.aspfor ASP: http://www.w3schools.com/asp/asp_inputforms.aspIf you run into trouble writing the script then there are forums here for both the above languages and someone will help you out. :)

Link to comment
Share on other sites

    <script language="JavaScript">      <!--      function Try(passwd) {        if (passwd =="password") {          alert("Correct password");          location.href = "www.yourwebsite.com";        }        else {          alert("The password is incorrect. Please don't try again.");          location.href = "www.wrong-password-url.com";        }      }      //-->    </script>

Link to comment
Share on other sites

JavaScript is totally not the answer. I can always turn my JavaScript and see the page OR look at the source code and copy the right URL.An .htaccess file could do it, but then again, a server side would be better.

Link to comment
Share on other sites

JavaScript is the last thing you would want to use for processing a form containing username and password.All i would have to do is view source, see that information and that's me at your page. It's like password protecting your pc then leaving your little black book of passwords beside it for anyone to see, it kinda defeats the purpose! :) Read up on your server side language :)

Link to comment
Share on other sites

  • 8 months later...
yes but who knows how to do that? mabie about 1% of people so the chances are it will work
Actually it is very easy to do. It is not a good idea to process iportant info like username and password with JS
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...