All pastes #674444 Raw Edit

Someone

public php v1 · immutable
#674444 ·published 2007-08-29 07:54 UTC
rendered paste body
// change this:elseif ($_GET['page'] == "blog" && ctype_digit($_GET['year']) && ctype_digit($_GET['month']))    {    $date = $_GET['year'].$_GET['month'];    echo $date;    if ($result = mysql_query("SELECT * FROM blog WHERE date = $date"))			// change it to...	elseif ($_GET['page'] == "blog" && ctype_digit($_GET['year']) && ctype_digit($_GET['month']))    {		$month = intval($_GET['month']);	$year =  intval($_GET['year']);	$cyear = date('Y');		if ( $month < 1 or $month > 12 )	{		$month =  date('n');	}		if ( $year < 1970 or $year >$cyear )	{		$year = $cyear;	}		$start = gmmktime ( 0, 0, 0, $month, 1, $year ) - 1;	$end = strtotime ( '+1 month', $start );		if ($result = mysql_query("SELECT * FROM blog WHERE `date` > $start and `date` < $end"))