Sending a request (post or get) without leaving the page
Posted: Thu Jun 26, 2008 6:08 pm
I am querying a MySQL database for events that need to be run on another server. When an event time comes up I need to send a request (either post or get) to the other server to start that event. There may be more than one event to be started at the same time. I need to check for events to be run up to 15 minutes prior to the event time.
Here is what I have so far:
<?php
// Check for events to be run
$strSQL = "SELECT * from tblque WHERE EventDate = CURDATE() AND EventRun = '0' AND (EventTime >= CURTIME() AND EventTime <= ADDTIME(CURTIME(), '15:00'))";
// echo $strSQL;
$resultr = mysql_query($strSQL);
while ($rowRun = mysql_fetch_array($resultr)) {
if (mysql_num_rows($resultr) > 0) {
echo "RUN EVENT"; // This is where the HTTP request goes so the query can loop through the results
// echo "<meta http-equiv=\"refresh\" content=\"0;URL=http://test.php?action=edit&EventID=" . $rowRun['EventID'] . "\">";
}
else {
echo "NO EVENTS";
}
}
?>
Here is what I have so far:
<?php
// Check for events to be run
$strSQL = "SELECT * from tblque WHERE EventDate = CURDATE() AND EventRun = '0' AND (EventTime >= CURTIME() AND EventTime <= ADDTIME(CURTIME(), '15:00'))";
// echo $strSQL;
$resultr = mysql_query($strSQL);
while ($rowRun = mysql_fetch_array($resultr)) {
if (mysql_num_rows($resultr) > 0) {
echo "RUN EVENT"; // This is where the HTTP request goes so the query can loop through the results
// echo "<meta http-equiv=\"refresh\" content=\"0;URL=http://test.php?action=edit&EventID=" . $rowRun['EventID'] . "\">";
}
else {
echo "NO EVENTS";
}
}
?>