Code Generator in PHP
Submitted by jkev on Tuesday, May 21, 2013 - 22:08.
Language
Hi guys,
This code will teach you on how to generate a random code using PHP. To generate a new random code, just click the refresh button.
Sample code:
- <?php
- include('header.php');
- ?>
- <html>
- <body>
- <div class="container">
- <?php
- function randomcode() {
- $var = "abcdefghijkmnopqrstuvwxyz0123456789";
- $i = 0;
- $code = '' ;
- while ($i <= 7) {
- $code = $code . $tmp;
- $i++;
- }
- return $code;
- }
- ?>
- <h1>
- <?php
- echo randomcode();
- ?>
- </h1>
- <br>
- <a href="index.php" class="btn btn-info">Refresh</a>
- </div>
- </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
- 87 views