I am trying to run an update query depending on the outcome of this conditional statement but I don’t have any idea as to what I need to do to get what I want. I need the statement to run the update if it was called by either CRON or from the admin panel via a button click in the page googlesitemaps.php. Here is what I have and I know it does not work the way I want it to.
if (!eregi("googlesitemap.php", $_SERVER['PHP_SELF'])) {
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input('true') . "', last_modified = now() where configuration_id = 11 ");
}else{
// Do nothing
}
I know that PHP_SELF is returning the value of the current page this code is in so it is running no matter what page calls this page. I need the magic code that tells me what called the page that this code is in.
I have searched for two days trying to find an answer to this question (not here). I think my main problem is not knowing exactly what keywords to use when using the search engines. I really don’t know how else to ask this question. Perhaps someone more familiar with PHP could formulate a better question out of what I have explained.
Thank you!
Gary