Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <title>PHP Count Script!</title>
- <body>
- <!-- Form -->
- <form action="count.php" method="POST">
- Count from:<input type="text" name="text1"><br>
- Count to:<input type="text" name="text2"><br>
- <input type="submit" name="submit" value="Count!">
- </form>
- Notice: The larger the number between, the longer the load time.<br>
- </body>
- </html>
- <?php
- if ($_POST['submit'])
- {
- $text1 = $_POST['text1'];
- $text2 = $_POST['text2'];
- if ($text1&&$text2)
- {
- if ($text1 > $text2)
- {
- die("The Count from number cannot be greater than the Count to number!");
- }
- $text1 = $text1 - 1;
- while($text2 > $text1) {
- $text1 = ($text1 + 1);
- echo $text1.'<br>';
- }
- }
- else
- die("Please fill in all boxes!");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement