Show DevBest Numbery thing

Status
Not open for further replies.

Macemore

Circumcised pineapples
Aug 26, 2011
1,681
819


Basically said that my password was 13 octillion quinquagintillion years, I googled each one and said that (together) it was 10^180, or 1, with 180 zeroes behind it. (1e+180) so I made this so I could figure out how long that was.
PHP:
<?php
if(isset($_GET['submit'])) {
if(isset($_GET['input']) && isset($_GET['num']) && isset($_GET['var']) && is_numeric($_GET['input']) && is_numeric($_GET['num']) && is_numeric($_GET['var']) ) {
$input = $_GET['input'];
$num = $_GET['num'] + 1;
$var = $_GET['var'];
echo str_pad($input, $num, $var, STR_PAD_RIGHT);
} else {
echo "Don goof'd";
}
} else {
echo "<html>
<body>
<form method='get' action='gen.php'>
Start number <input type='text' name='input' />
Number to add <input type='text' name='var' />
How many to add <input type='text' name='num' />
<input type='hidden' name='submit' value='1' />
<input type='submit' value='submit' />
</form>
</body>
</html>";
}
?>

I made it into a form for people that can't really use the $_GET in the url.
you can also do CTRL + H in notepad and change $_GET to $_POST and should work fine.


EDIT:

if you change from $_GET to $_POST you need to go to line 14, and change
HTML:
<form method='get' action='gen.php'>
to:
HTML:
<form method='post' action='gen.php'>
change gen.php to whatever you save the file name to.
 
Status
Not open for further replies.

Users who are viewing this thread

Top