$v) { $in[$k] = stripslashes($v); } } # clean and validate data if(preg_match("/\btest\b/i", $in['sdesc'])) { $errors[] = 'We know this works. Please do not test the system.'; } if(preg_match("/\btest\b/i", $in['ldesc'])) { $errors[] = 'We know this works. Please do not test the system.'; } if (!is_emailable_address($in['email'])) { $errors[] = 'You must supply a valid email address.'; } $in['sdesc'] = trim($in['sdesc']); if (!$in['sdesc']) { $errors[] = "You must supply a short description of the event."; } $in['ldesc'] = trim(strip_tags($in['ldesc'],'

')); $in['ldesc'] = preg_replace("/(style|on\\w+?)\s*=\s*(\"|').+?\\2/i","",$in['ldesc']); if (!$in['ldesc']) { $errors[] = "You must supply a long description of the event."; } $in['url'] = trim($in['url']); if (!$in['url']) { $errors[] = "You must supply a URL with more information about the event."; } elseif (!preg_match('/^\w+:/',$in['url'])) { $errors[] = "The URL you supplied was incomplete."; } if (!$in['country']) { $errors[] = 'You must specify a country for the event.'; } if (!$in['category']) { $errors[] = 'You must specify a category for the event.'; } if (!checkdate($in['smonth'], $in['sday'], $in['syear'])) { $errors[] = "You must specify a valid start date."; } else { $sdate = mktime(0,0,1,$in['smonth'], $in['sday'], $in['syear']); if ($sdate < time()) { $errors[] = "You must specify a start date that is in the future."; } } if ($in['type'] == 'multi' && !checkdate($in['emonth'], $in['eday'], $in['eyear'])) { $errors[] = "You must specify a valid end date for a multi-day event."; } elseif ($in['type'] == 'multi' && checkdate($in['smonth'], $in['sday'], $in['syear'])) { $sdate = mktime(0,0,1,$in['smonth'], $in['sday'], $in['syear']); $edate = mktime(0,0,1,$in['emonth'], $in['eday'], $in['eyear']); if ($edate < time()) { $errors[] = "You must specify an end date that is in the future."; } elseif ($edate < $sdate) { $errors[] = "You must specify an end date that is after the start date."; } } if ($in['type'] == 'recur' && !($in['recur'] && $in['recur_day'])) { $errors[] = "You must specify a valid day of the month for a recurring event."; } if (preg_match("/submit/i", $action)) { # submit to master.php.net $result = posttohost("http://master.php.net/entry/event.php", $in); if ($result) { $errors[] = "There was an error processing your submission: $result"; } if (!$errors) {?>

Thank you for your submission! You should hear back soon as to whether your event has been accepted for inclusion in our calendar.

The following is a preview of your event submission. Please double-check it to make sure all of the information is correct.

Have an upcoming PHP user group meeting? Holding a PHP training session? Submit your event here, and after it has been approved, it will be listed on the PHP.net homepage and appear in our full event listings.

'First',2=>'Second',3=>'Third',4=>'Fourth',-1=>'Last',-2=>'2nd Last',-3=>'3rd Last'); if (isset($in)) { echo "

Preview:

\n"; display_event($in); ?>

Change:

Start Date " /> />
End Date " /> />
OR
Recurring
/>
Short
Description
URL
Country
Event Category
Email
  This email address is only used to contact you about the listing, it will not displayed along with the listing.
Long Description
$v) { echo '\n"; } }