1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Apply new include and base page code

Use _GET instead of depending on register_globals
This commit is contained in:
Gabor Hojtsy
2003-08-09 14:44:41 +00:00
parent e453d3ef69
commit eeafa72a9a

18
cal.php
View File

@@ -1,21 +1,23 @@
<?php
include_once 'prepend.inc';
// $Id$
$_SERVER['BASE_PAGE'] = 'cal.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
/*
This script serves three different forms of the calendar data:
a monthly view ($cm, $cy)
a daily view ($cm, $cd, $cy)
an individual item view ($id)
For the two later, the month view is also displayed beneath the specifically
asked data. If we encounter an error, we have a fallback to display the
actual month/year.
For the last two, the month view is also displayed beneath the
specifically requested data. If we encounter an error, we have
a fallback to display the actual month/year.
*/
$begun = FALSE; $errors = array();
$id = isset($id) ? (int) $id : 0;
$cy = isset($cy) ? (int) $cy : 0;
$cm = isset($cm) ? (int) $cm : 0;
$cd = isset($cd) ? (int) $cd : 0;
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$cy = isset($_GET['cy']) ? (int) $_GET['cy'] : 0;
$cm = isset($_GET['cm']) ? (int) $_GET['cm'] : 0;
$cd = isset($_GET['cd']) ? (int) $_GET['cd'] : 0;
// If the year is not valid, set it to the current year
// This excludes all the "too old", or "too far in the future"