I have a script for a calendar and I am not sure how to foward to the calendar if a paticular ID is not found because it has been deleted from the database.
The reason is, Google is indexing the pages and when the deleted page is clicked on from google, it shows a blank page. I need to forward the page to the calendar if the id isnt found.
Here is the code, any help would be greatly appreciated.
<?
require_once("includes/config.php");
$db_connection = mysql_connect ($DBHost, $DBUser, $DBPass) OR die (mysql_error());
$db_select = mysql_select_db ($DBName) or die (mysql_error());
$db_table = $TBL_PR . "events";
$query = "SELECT * FROM $db_table WHERE event_id='$_GET[id]' LIMIT 1";
$query_result = mysql_query ($query);
while ($info = mysql_fetch_array($query_result)){
$date = date ("l, jS F Y", mktime(0,0,0,$info['event_month'],$info['event_day'],$info['event_year']));
$time_array = split(":", $info['event_time']);
$time = date ("g:ia", mktime($time_array['0'],$time_array['1'],0,$info['event_month'],$info['event_day'],$info['event_year']));
?>