Error(s):
Parse error: parse error, unexpected $ in index.php on line 188
Fatal error: Call to a member function on a non-object in index.php on line 51
Fatal error: Call to a member function on a non-object in index.php on line 51
Code: Select all
<?php
error_reporting(E_ERROR|E_WARNING|E_PARSE);
set_magic_quotes_runtime(0);
$template = new template;
$gus = new site;
$VARS = $gus->parse_incoming();
switch($VARS['act'])
{
case 'news':
load_archives();
break;
case 'games':
load_coverage();
break;
case 'media':
load_media();
break;
case 'interactive':
load_interactive();
break;
case 'other':
load_other();
break;
case 'affiliates':
load_affiliates();
break;
case 'network':
load_network();
break;
default:
load_home();
break;
}
function load_home() {
$output = '';
$output .= $template->page_head();
$output = str_replace( "<% CSS %>", $template->css(), $output );
echo $output;
}
class template {
function page_head($title) {
return <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<% CSS %>
<title>Games Unlimited - $title</title>
</head>
<body>
<a name='top'></a>
<table width='700' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td class='vspacer' colspan='3'>
</td>
</tr>
<tr>
<td colspan='3'>
<table width='700' border='1' cellpadding='0' cellspacing='0'>
<tr>
<td rowspan='3'>
<a href='http://www.guforums.net/home/'><img src='http://www.guforums.net/gamesunlimited.jpg' border='0' alt='' /></a>
</td>
</tr>
EOF;
}
function css() {
return <<<EOF
<style type='text/css'>
.website{width:700px;border-width:0px;font-family:tahoma;font-size:11px}
.vspacer{height:20px}
.hspacer{width:50px}
.cspacer{width:10px}
</style>
EOF;
}
}
class site {
function parse_incoming()
{
global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_CLIENT_IP, $REQUEST_METHOD, $REMOTE_ADDR, $HTTP_PROXY_USER, $HTTP_X_FORWARDED_FOR;
$return = array();
if( is_array($HTTP_GET_VARS) )
{
while( list($k, $v) = each($HTTP_GET_VARS) )
{
//$k = $this->clean_key($k);
if( is_array($HTTP_GET_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
{
$return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2);
}
}
else
{
$return[$k] = $this->clean_value($v);
}
}
}
if( is_array($HTTP_POST_VARS) )
{
while( list($k, $v) = each($HTTP_POST_VARS) )
{
//$k = $this->clean_key($k);
if ( is_array($HTTP_POST_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
{
$return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2);
}
}
else
{
$return[$k] = $this->clean_value($v);
}
}
}
return $return;
}
function clean_key($key) {
if ($key == "")
{
return "";
}
$key = preg_replace( "/\.\./" , "" , $key );
$key = preg_replace( "/\_\_(.+?)\_\_/" , "" , $key );
$key = preg_replace( "/^([\w\.\-\_]+)$/", "$1", $key );
return $key;
}
function clean_value($val) {
if ($val == "")
{
return "";
}
$val = preg_replace( "/&/" , "&" , $val );
$val = preg_replace( "/<!--/" , "<!--" , $val );
$val = preg_replace( "/-->/" , "-->" , $val );
$val = preg_replace( "/<script/i" , "<script" , $val );
$val = preg_replace( "/>/" , ">" , $val );
$val = preg_replace( "/</" , "<" , $val );
$val = preg_replace( "/"/" , """ , $val );
$val = preg_replace( "/\|/" , "|" , $val );
$val = preg_replace( "/\n/" , "<br>" , $val );
$val = preg_replace( "/\\\$/" , "$" , $val );
$val = preg_replace( "/\r/" , "" , $val );
$val = preg_replace( "/!/" , "!" , $val );
$val = preg_replace( "/'/" , "'" , $val );
$val = stripslashes($val);
$val = preg_replace( "/\\\/" , "\" , $val );
return $val;
}
}
?>