Captcha Script
Submitted by jkev on Sunday, May 19, 2013 - 16:08.
Language
Hi guys,
I have here a captcha source code that enables you to generate a random code and protect your page for spammers. You can insert this code to your project as a type of test that the response is generated by a human being.
For more question about this code email me at [email protected].
Thank you.
- <?php
- include('header.php');
- ?>
- <html>
- <body>
- <br>
- <br>
- <form class="form-horizontal" method="POST">
- <div class="control-group">
- <label class="control-label" for="inputEmail"></label>
- <div class="controls"> <img src="generatecaptcha.php?rand=<?php echo rand(); ?>" id='captchaimg' > <a href='javascript: refreshCaptcha();'><i class="icon-refresh icon-large"></i></a>
- <script language='JavaScript' type='text/javascript'>
- function refreshCaptcha()
- {
- var img = document.images['captchaimg'];
- img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?rand="+Math.random()*1000;
- }
- </script>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="inputPassword">Enter the Code Above</label>
- <div class="controls">
- <input id="code" name="code" type="text" placeholder="Enter the Code Above" required>
- </td>
- </div>
- </div>
- <div class="control-group">
- <div class="controls">
- <button type="submit" name="submit" class="btn btn-info">Submit</button>
- </div>
- </div>
- </form>
- <?php
- {
- {
- ?>
- <div class="span4">
- <div class="alert alert-danger">The captcha code does not match!</div>
- </div>
- <?php
- }else{ ?>
- <div class="span4">
- <div class="alert alert-success">Code Match</div>
- </div>
- <?php
- }}
- ?>
- </body>
- </html>
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Add new comment
- 189 views