cvs: phpweb / submit-event.php /include posttohost.inc
| From: | Jacques Marneweck | Date: | Wed, 14 May 2003 01:43:48 +0000 |
| Subject: | cvs: phpweb / submit-event.php /include posttohost.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-17605@lists.php.net to get a copy of this message | ||
jacques Tue May 13 21:43:48 2003 EDT
Modified files:
/phpweb submit-event.php
/phpweb/include posttohost.inc
Log:
* Busy fixing all the errors that appears when E_NOTICE is set on php.net
as reported by James Cox in his e-mail with message id
<MMEPJPGPACDMPGEEKFMKIECLLCAA.james@imajes.info>
--jm
Index: phpweb/submit-event.php
diff -u phpweb/submit-event.php:1.15 phpweb/submit-event.php:1.16
--- phpweb/submit-event.php:1.15 Fri Apr 25 18:51:23 2003
+++ phpweb/submit-event.php Tue May 13 21:43:47 2003
@@ -6,8 +6,27 @@
commonHeader("Submit an Event");
$errors = array();
+$process = FALSE;
-if (isset($in)) {
+if (isset($in)) { $process = TRUE; }
+
+if (!isset($in['type'])) { $in['type'] = ""; }
+if (!isset($in['sday'])) { $in['sday'] = ""; }
+if (!isset($in['smonth'])) { $in['smonth'] = ""; }
+if (!isset($in['syear'])) { $in['syear'] = ""; }
+if (!isset($in['eday'])) { $in['eday'] = ""; }
+if (!isset($in['emonth'])) { $in['emonth'] = ""; }
+if (!isset($in['eyear'])) { $in['eyear'] = ""; }
+if (!isset($in['recur'])) { $in['recur'] = ""; }
+if (!isset($in['recur_day'])) { $in['recur_day'] = ""; }
+if (!isset($in['country'])) { $in['country'] = ""; }
+if (!isset($in['category'])) { $in['category'] = ""; }
+if (!isset($in['email'])) { $in['email'] = ""; }
+if (!isset($in['url'])) { $in['url'] = ""; }
+if (!isset($in['ldesc'])) { $in['ldesc'] = ""; }
+if (!isset($in['sdesc'])) { $in['sdesc'] = ""; }
+
+if (isset($in) && $process) {
# clean up magic quotes, if they were inserted
if (get_magic_quotes_gpc()) {
foreach ($in as $k => $v) {
@@ -124,8 +143,9 @@
$re =
array(1=>'First',2=>'Second',3=>'Third',4=>'Fourth',-1=>'Last',-2=>'2nd
Last',-3=>'3rd Last');
-if (isset($in)) {
+if (isset($in) && $process) {
echo "<p><b>Preview:</b></p>\n";
+
display_event($in);
?>
<p><b>Change:</b></p>
@@ -207,7 +227,7 @@
<tr>
<td align="center" colspan="2">
<input type="submit" name="action" value="Preview" />
-<?php if (isset($in)) {?>
+<?php if (isset($in) && $process) {?>
<input type="submit" name="action" value="Submit" />
<?php }?>
</td>
@@ -224,3 +244,5 @@
'>', htmlentities($v), "</option>\n";
}
}
+
+/* vim: set noet ts=4 sw=4 ft=php: : */
Index: phpweb/include/posttohost.inc
diff -u phpweb/include/posttohost.inc:1.1 phpweb/include/posttohost.inc:1.2
--- phpweb/include/posttohost.inc:1.1 Sat Sep 22 22:07:02 2001
+++ phpweb/include/posttohost.inc Tue May 13 21:43:47 2003
@@ -3,6 +3,8 @@
function posttohost($url, $data) {
$url = parse_url($url);
if (!$url) return "couldn't parse url";
+ if (!isset($url['port'])) { $url['port'] = ""; }
+ if (!isset($url['query'])) { $url['query'] = ""; }
$encoded = "";