Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with password protection code

    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.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,312
    Thanks
    23
    Thanked 612 Times in 611 Posts
    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" />

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Jul 2011
    Location
    India
    Posts
    496
    Thanks
    3
    Thanked 57 Times in 56 Posts
    Quote Originally Posted by Vagodeoz View Post
    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???

  • #5
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,758
    Thanks
    41
    Thanked 191 Times in 190 Posts
    Quote Originally Posted by vikram1vicky View Post
    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???
    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
    Code:
    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

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #6
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by alykins View Post
    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?

  • #7
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,758
    Thanks
    41
    Thanked 191 Times in 190 Posts
    Quote Originally Posted by Vagodeoz View Post
    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

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #8
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

    Code:
    <!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"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •