Automatic Delete
hi ,great work,
you are using the variable +$numdays for add the day but can you tell me how we make a variable for +hours in mktime.
<!DOCTYPE html> <html> <head> <title>Automated Delete Product Date Expiry</title> </head> <body> <div class="tab-pane fade in active" id="archieve"> <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example"> <thead> <?php if (!$con) { } ?> <?php if (!$con) { } echo "<div align='center'>Note: the data will automatically deleted when it reach the expiry date"."</div><br>"; echo " <tr> <th>Product</th> <th>Description</th> <th>Expiry date</th> </tr>"; { echo "<tr>"; echo "<td><div align='center'>" . $row['product'] . "</td>"; echo "<td><div align='center'>" . $row['description'] . "</td>"; echo "<td><div align='center'>" . $row['expiry'] . "</td>"; echo "</tr>"; } echo "</table>"; ?> </tbody> </table> </div> </body> </html>
<!DOCTYPE html> <html> <head> </head> <style> .containers{ margin-right:345px; margin-left:320px; } </style> <body> <div class="tab-pane fade"id="add"> <div class="containers"> <p align="center" style="color:#000">Fill Up All The Details Below!</p> <form class="form-horizontal" method="POST" action="save.php"> <div class="form-group"> <label class="control-label col-sm-2" for="product">Product:</label> <div class="span4"> <input type="text" name="product" class="form-control" id="product" placeholder="Product" required> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="description">Description:</label> <div class="span4"> <input type="text" name="description" class="form-control" id="description" placeholder="Description" required> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="numdays">Number of Days:</label> <div class="span4"> <input type="text" name="numdays" class="form-control" id="numdays" placeholder="Number of Days" required> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" name="submit" class="btn btn-primary">Submit</button> </div> </div> </form> </div> </div> </body> </html>
<?php if (!$con) { } $numdays=$_POST['numdays']; $product=$_POST['product']; $description=$_POST['description']; mysql_query("INSERT INTO prod_list(product, description, expiry)VALUES('$product', '$description', '$dats')"); ?>