PHP Program with Simple Time Machine
I had found a PHP program that has the time machine. This is very simple program with mktime () and date () functions.
To do this, you must make first HTML form for the adoption of the name of the user and the number for to go further days (ie Future).
The code is as follows:
<form action = "welcome.php" method = "POST"> <table> <tr><td> Enter Name:</td><td><input type = "text" name = "name"> </td></tr> <br /> <tr><td> Enter Number:</td><td> <input type = "text" name = "num"> </td></tr> <br / > <tr><td> <input type = "submit"> </td><tr> </table> </form>
After that you should make another page for PHP code. The code is given below,
<?php
$name = $_POST['name'];
$num = $_POST['num'];
echo “Welcome <b> “.$name;
echo “</b> <br><br><hr>”;
for($i=1;$i<=$num;$i++)
{
$tomorrow = mktime(0,0,0,date(”m”),date(”d”)+$i,date(”Y”));
if($i==$num)
{ echo “<br><hr><b>”;
echo ” Welcome to the future !!! “.date(”m-d-Y”,$tomorrow);
echo “</b> <br>”;
echo $name.”, You are in future… “;
}
else
{
echo date(”m-d-Y”,$tomorrow).” You was going through this date to the future<br>”;
}
}
?>
Start the Apache server or any PHP server and run this program on the server, and Enjoy The Time Machine.