Code: Select all
$nba=$_GET ['nba'];// get variable from url
if (!$nba) {// check to see if $nba is set in the url
define ("NBA", date("Ymd"));
$nba_year=date("Y");
$nba_month=$month;
$nba_day=$day;
} else {// if not set in the url make nba time today
define("NBA", $nba);
$nba_year=substr(NBA, 0, 4);// Careful! This converts numbers into strings!
$nba_month=substr(NBA, 4, 2);// Careful! This converts numbers into strings!
$nba_day=substr(NBA, 6, 2);// Careful! This converts numbers into strings!
}Notice: Undefined index: nba in /Users/jyhm/Sites/phpadv_ch1/nba_functions.php on line 20