I need to send post data to another page programatically. I have 2 DateTime in Database I want to compare these DateTimes. and if one of them is bigger than another automatically send post data to another page.
this is simple code:
require('connect.php');
$sql = 'SELECT * FROM POSTS ORDER BY POSTDATETIME ASC';
$result = $conn->query($sql);
if($result->num_rows>0)
{
while($row=$result->fetch_assoc())
{
echo $row["ID"].".".$row["PostDateTime"]."<br/>";
$text = $row["Text"];
$d = new DateTime("now");
$d1 = new DateTime($row["PostDateTime"]);
if($d>$d1)
{
// Send Post Data to another page;
}
else
{
echo "false<br/>";
}
}
}
I googled but there is no way to send automatically post data without any form or ajax . ajax needs to some event occurs. And I don't have any Idea how to do that . I will appreciate any tips.