...

View Full Version : Need help with password protection code



Vagodeoz
09-12-2011, 06:41 AM
Hello people!
I`m in need of a very very simple script.
I`m going to have a temporary website with a password field, and I`m going to give away free codes so people can download a file.
So I want people to write the code in the field, I want the code to be shown in the field and not hidden, and I want that after he clicks ok, it redirects the user to the file.
Very simple right? :)

So can anyone please give me a hand with this?

Ps: I found similar scripts but they all hide the password.

sunfighter
09-12-2011, 03:56 PM
Ps: I found similar scripts but they all hide the password.

OK you have the script then. The password is hidden probably because they use type=password as the attribute for the input tag:
<input type="password" id="something" />

Change this to
<input type="text" id="something" />

Vagodeoz
09-13-2011, 05:39 AM
Does anyone have a script that will do that?
I found some tutorials and a lot of scripts but I really don`t know much about coding, so I can`t tell the difference between them.

vikram1vicky
09-13-2011, 09:23 AM
Hello people!
I`m in need of a very very simple script.
I`m going to have a temporary website with a password field, and I`m going to give away free codes so people can download a file.
So I want people to write the code in the field, I want the code to be shown in the field and not hidden, and I want that after he clicks ok, it redirects the user to the file.
Very simple right? :)

So can anyone please give me a hand with this?

Ps: I found similar scripts but they all hide the password.


If you want password/code field should be visible and you will give away that code free... Then why you need password...

Password is always used for security purpose only and must be hidden only...

If you dont want any security, then what's the need of password??? :cool:

alykins
09-13-2011, 07:02 PM
If you want password/code field should be visible and you will give away that code free... Then why you need password...

Password is always used for security purpose only and must be hidden only...

If you dont want any security, then what's the need of password??? :cool:

maybe it's a prize thing or something and you need to see the code as you enter it to ensure you are typing it correctly? idk you have good point though...

@OP... Need to know what other languages you are using to validate. But you could have something as simple as


if (input== "OneTwoThree")
document.getelementbyid('codebox').style.visibility='visible';
else
document.getelementbyid('wrongpass').style.visibility='visible';

or some other off the wall random code... basically without knowing what language you are trying to do this in we cannot help

Vagodeoz
09-14-2011, 12:22 AM
maybe it's a prize thing or something and you need to see the code as you enter it to ensure you are typing it correctly? idk you have good point though...


It`s exactly that.
It`s not secret or password protected. It`s just a digital gift.

And the code we will use is PHP. Will that code you posted will work with PHP?

alykins
09-14-2011, 01:40 AM
It`s exactly that.
It`s not secret or password protected. It`s just a digital gift.

And the code we will use is PHP. Will that code you posted will work with PHP?

no... not really... with some tweaking... what I posted was an if statement (not proper javascript format me thinks) along with some javascript... you will need to and should do it php... unfortunately i do not know php; i do asp

Vagodeoz
09-14-2011, 04:40 AM
A friend`s friend made me a favor and wrote this.
However I think it has a flaw somewhere, becouse I open it on a website and I see most of the code below the field and the submit button.
Can someone please take a loot at this?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
body{
background-color:#000;
color:#FFF;
width:600px;
margin-left:auto;
margin-right:auto;
margin-top:150px;
}
h3{
color:#CCC;
text-align:center;
}
a{
color:#FFF;
font-size:25px;}
</style>
<title>Cupon Gratis</title>
</head>

<body>
<?
$form='<h3>Ingrese el c&oacute;digo para ver el link de descarga</h3>
<form action="index.php" method="post">
<center><input name="codigo" type="text" /><br/>
<input name="enviar" type="submit" value="DESCARGAR" /><center>
</form>';
if(isset($_POST["enviar"])){
if($_POST["codigo"]=='12345'){
echo '<center><a href="http://www.megaupload.com">INICIAR DESCARGA</a></center>';
}
else{echo'<h3 style="color:red;">C&oacute;digo incorrecto</h3>'; echo $form;}
}
else{ echo $form;}
?>
</body>
</html>


Edit: On Dreamweaver I click on validation and it says "in tag: style the following required attributes are missing: type XHTML 1.0 transitional"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum