FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Password problem

 


mtorregiani
I have this script founded on The JavaScript Source but I think you can manage to avoid it

Code:
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; }
if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; }
if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; }
if (done==0) { alert("Invalid login!"); }
}
// End -->
</SCRIPT>
</HEAD>
<BODY>

<center>
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username></td></tr>
<tr><td>Password:</td><td><input type=text name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
</table>
</form>
</center>

</body>
</html>

______________________________________________________________
For example, if ...

Code:
if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; }


... you put Password=> password1 | and Username=>member1, you go to page1.html (for example, www.frihost.com/toto/page1.html)

And here comes the problem

If you go to www.frihost.com/toto/page1.html you don't have to put any password

Is there any way to 'hide' (protect) page1.html???
Sorry for my bad english, I hope you understand me Very Happy
Rhysige
Using Javascript as a login system is asking for hackers... even a newb can get past a javascript login system since all javascript source is visible. I suggest PHP since part of what makes PHP strong is it is server side meaning the only information that is sent to the computer is what to display not the backing code of functions etc.
clip
true, Javascript wouldn't be recommended for login scripts, PHP will be the solution. Very Happy
mtorregiani
yes but i don't know php
Can somebody help me?
shamil
mtorregiani wrote:
yes but i don't know php
Can somebody help me?


If you familiar with any of the C,Pascal or similar programming languages it will be more easy to learn PHP. Google PHP TUTORAL you will find a lot of thing to read.
clip
buy a book or find an ebook. I think it's the fastest way to learn, the right, and the most detailed kind of way. ^^
Related topics

Password problem again...my fault.
login password problem
mySQL application install password problem in JSAS
password problem
Why are no admins helping me?

Please Reset my DirectAdmin Password
Email Config : MX record and passwor
No access to FTP and cPanel
MySql upgrade...
Server 3 down today (obviously fixed)

Convert from PDF format to Word Document...
Problem with my password
HELP! I registered, but never got my confirmation email.
problem on advance guestbook
an annoying problem - PLEASE help
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.