-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
29 lines (28 loc) · 970 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once 'randomGen.php';
//$_SERVER["PHP_SELF"] the safe way!
$myForm = filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_SPECIAL_CHARS);
$myGenerator = new RandomGen();
$CouponLength = filter_input(INPUT_POST, 'CouponLength');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>This is a testing random engine</title>
</head>
<body>
<form method="post" action="<?php echo $myForm; ?>">
<input type="text" name="CouponLength" value="<?php echo $CouponLength; ?>">
<input type="submit" name="submit" value="Click to Generate">
</form>
<p>This is what the button returns. A random set of characters. Like a coupon.</p>
<p>
<?php
if(filter_has_var(INPUT_POST, 'CouponLength')) {
echo $myGenerator->UseGenerator($CouponLength);
}
?>
</p>
</body>
</html>