Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » password textbox


password textbox

Reply
  #11 (permalink)  
Old 06-07-04, 08:10 PM
infinitylimit's Avatar
infinitylimit infinitylimit is offline
Code Guru
 
Join Date: Jun 2004
Location: Oregon
Posts: 758
Thanks: 0
Thanked 0 Times in 0 Posts
I think security isn't such a huge issue you can do this.

<script type="javascript">
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}

function check_md5(s){
if (hex_md5(s) == "YOUR MD5 HERE"){
window.location = s + .html?";
}
else{
return false;
}
}
function echo_md5(s){
alert(hex_md5(s));
}
</script>

Then in your html do this
<form onSubmit="echo_md5(this.password.value);">
<input type="text" name="password">
<input type="submit" value="generate MD5">
</form>

After using the above replace the YOUR MD5 HERE with what the alert box says. Also name your secondpage the name of your password.

Then make your passform and put onsubmit="check_md5(this.password.value);"

This will stop most.... code wasn't tested but the prinicple should work.

-IL
__________________
Hawk Enterprises -- Home to PHP games, open-source code, tutorials and free downloads
Reply With Quote
  #12 (permalink)  
Old 06-08-04, 11:41 AM
infinitylimit's Avatar
infinitylimit infinitylimit is offline
Code Guru
 
Join Date: Jun 2004
Location: Oregon
Posts: 758
Thanks: 0
Thanked 0 Times in 0 Posts
I was bored enough to make a working demo of this.

http://clients.infinitylimit.com/demos/md5password.htm
__________________
Hawk Enterprises -- Home to PHP games, open-source code, tutorials and free downloads
Reply With Quote
  #13 (permalink)  
Old 06-16-04, 02:08 PM
neozen neozen is offline
New Member
 
Join Date: Jun 2004
Location: chile
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb

as someone said using this:

<?
$password = "whatever";

if ($password == "$password"){

header("Location: http://mysite.com/secret.php");
}
else{
echo "sorry wrong pasword, please try again";
}
?>

may alow access to secret.php and therefore be unusefull.
the thing is if instead of redirecting you @requireonce() the secret page it's uri will be parsed by php and never revealed in the adress bar.

guess that might work.
Reply With Quote
  #14 (permalink)  
Old 06-16-04, 10:51 PM
darkcarnival's Avatar
darkcarnival darkcarnival is offline
PHP/MySQL coder
 
Join Date: Jun 2003
Posts: 939
Thanks: 0
Thanked 0 Times in 0 Posts
well you can add a if clause that asks to see if your a admin or a member or whatever.
Reply With Quote
  #15 (permalink)  
Old 07-07-04, 09:56 AM
ShadowCat ShadowCat is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
I just thought of this, and am not sure it would work. You could do
Code:
<html>
<head>

<script src="ext"></script> 
<SCRIPT Language="JavaScript">
var passwd;

function protect(passwd) {
if (passwd==PASSWORD) {
window.location=RIGHTPAGE;
}
else {
window.location=WRONGPAGE;
}
}
</SCRIPT>
</head>
<body>
<form name="protected">
<input type="password" name="inputPwrd"></input>
<input type="button" name="enter" value="Enter" onClick="javascript:protect(document.protected.inputPwrd.value)"></input>
</body>
</html>
Then you would create a .txt file that says:
Code:
PASSWORD = "thepass";
RIGHTPAGE = "goodlocation";
WRONGPAGE = "badlocation";
and name name it ext.txt

This is very low security, but you could protect the page, so that no one could look at it. Whether getting info from a protected txt file would work, i'm not sure. That would give a decent amount of security, and I doubt anyone would know how to crack it with your audience.
Hope that helps!

PaYcE--->
-=Shadow*Cat=-
__________________
Check out my newly launched site, XGamers-- http://xgamers.uni.cc
Don't forget to apply for affiliation!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
lwp error: Receiving http 500 error when submitting..... Qish Perl 1 11-07-03 12:49 AM
In need of a user registration and password protect of a site darksoap Script Requests 2 09-29-03 02:35 PM
acessing password protected folder perleo PHP 1 09-26-03 08:36 PM
php and password Cmrdrv PHP 2 08-05-03 04:14 PM
Using IMAP to change password Man Down PHP 0 07-27-03 03:09 PM


All times are GMT -5. The time now is 08:57 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.