Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="" method="post" enctype="multipart/form-data">
- <label for="amount">Enter Amount</label>
- <input type="text" name="amount">
- <input type="hidden" name="today" value="<?php echo strtotime("now"); ?>">
- <input type="submit" name="submit" value="Submit">
- </form>
- <?php
- if(isset($_POST['submit']) && $_POST['submit'] == 'Submit') :
- $strtoday = $_POST['today'];
- $deadline = strtotime("31 March 2020");
- $today = date("Y-m-d", $strtoday);
- $endday = date("Y-m-d", $deadline);
- $secs = $deadline - $strtoday;
- $totalday = floor($secs / (24 * 60 * 60 ));
- $amount = $_POST['amount'];
- $array = array($today => $amount);
- echo "Today: ".$today."<br><br>";
- echo "Deadline: ".$endday."<br><br>";
- echo "Total Days: ".$totalday."<br><br>";
- //echo $today. " & Amount = ".$amount."<br>";
- for($i=0; $i<=$totalday; $i++) {
- $next = strtotime("+1 day", $strtoday);
- $nextday = date("Y-m-d", $next);
- $nextamount = $amount * 2;
- $strtoday = $next;
- $amount = $nextamount;
- $array[$nextday] = $nextamount;
- //echo $nextday. " & Amount = ".$nextamount."<br>";
- }
- foreach( $array as $key => $value ){
- echo $key."\t=>\t".$value."\n";
- }
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement