File: mkpassword.php

package info (click to toggle)
xcache 2.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,724 kB
  • sloc: ansic: 8,175; php: 4,557; awk: 285; sh: 135; makefile: 75
file content (24 lines) | stat: -rwxr-xr-x 575 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
	<head>
		<title>Simple MD5 password generator</title>
	</head>
	<body>
		<h1>Simple MD5 password generator</h1>
		<form method="post">
			<fieldset>
				md5: <input type="password" name="password"> <input type="submit"><br>
				<div>
				<?php
				if ($_SERVER['REQUEST_METHOD'] == 'POST') {
					$md5 = md5(@ $_POST['password']);
					$offs = mt_rand(0 + 1, 31 - 1);
					$md5_1 = substr($md5, 0, $offs);
					$md5_2 = substr($md5, $offs);
					echo "Result: <span>$md5_1</span><span>$md5_2</span>";
				}
				?>
				</div>
			</fieldset>
		</form>
	</body>
</html>