| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) | ||||
| Account Closed Join Date: Oct 2005 Location: India
Posts: 633
![]() ![]() ![]() | Login and Password Script. Simply insert this in the <body> section: ????: NamePros.com http://www.namepros.com/code/216895-login-and-password-script.html Code: <script language="javascript">
<!--//
/*This Script allows people to enter by using a form that asks for a
UserID and Password*/
function pasuser(form) {
if (form.id.value=="JavaScript") {
if (form.pass.value=="Kit") {
location="page2.html"
} else {
alert("Invalid Password")
}
} else { alert("Invalid UserID")
}
}
//-->
</script>
<center>
<table bgcolor="white" cellpadding="12" border="1">
<tr><td colspan="2"><center><h1><i><b>Login
Area</b></i></h1></center></td></tr>
<tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input
name="id" type="text"></td></tr>
<tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="pass"
type="password"></td></tr>
<tr><td><center><input type="button" value="Login"
onClick="pasuser(this.form)"></center></td><td><center><br><input
type="Reset"></form></td></tr></table></center>
Reputation is always appreciated. | ||||
| |
| | #5 (permalink) |
| NP Maniacâ„¢ Join Date: Apr 2004 Location: Nottingham, UK
Posts: 820
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | All you have to do to bypass this script is View Source - a more efficient method (still very basic), using PHP where they cannot bypass it as easily would be to use: Code: <?php
$userpass = $_POST['pass'];
if($userpass == "password") {
echo "Thank you for using this script.";
} else {
echo "That password was incorrect.";
}
?>
__________________ PHP/MySQL Development offered: PM me for a quote. 47ideas.com - my freelancing portfolio. |
| |
| | #7 (permalink) | ||||
| Senior Member Join Date: Jul 2005 Location: lebanon
Posts: 2,461
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | i guess that would be the simplest fix for this script i once used something similar to this
__________________ Download free MP3 _____________ Get unique visitors 4 NPs (over 800 satisfied) << Check the Holidays offer _____ Email me for fast response ryan [at] ryansdistrict.com ________ My 9000NPs R 4 SALE cheap- Contact me! | ||||
| |
| | #8 (permalink) |
| NamePros Regular Join Date: Jan 2006 Location: Palos Hills, IL
Posts: 844
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Nice script, rep added
__________________ Buying .com .net and .us domains |
| |
| | #10 (permalink) |
| Adsung.com Join Date: May 2006 Location: England
Posts: 1,624
![]() ![]() ![]() ![]() ![]() | you could just go to www.hotscripts.com and get a free simple on done for you!
__________________ Adsung |
| |