...

View Full Version : error somewhere



duggins
12-18-2003, 06:35 PM
i think theres an error on this page somewhere suppose to run on the newest version of php.. possible some old function that won't work in this code



<?php
require( "/home/gps/public_html/include/core/prepend.php" );

require( SITE_LAYOUT_AUTH_HEADER );

siteHeader();
?>

<body onLoad="document.loginForm.login_username.focus();">

<h4>Authentication</h4>

<form method="post" action="auth.php" name="loginForm">

<input type="hidden" name="r" value="<?php print $r; ?>" />

<table>
<tr>
<td>User Name:</td>
<td><input type="text" name="login_username" /></td>
</tr>

<tr>
<td>Password:</td>
<td><input type="password" name="login_password" /></td>
</tr>

<?php
if( $i )
{
?>

<tr>
<td>&nbsp;</td>
<td style="padding: 4px; border-left: 1px solid black; border-top: 1px solid black; border-right: 2px solid black; border-bottom: 2px solid black; background: rgb( 255, 255, 225 ); text-align: center;"><?php print $i; ?></td>
</tr>

<?php
}
?>

<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Authenticate" /></td>
</tr>
</table>

</form>


<?php
require( SITE_LAYOUT_AUTH_FOOTER );

siteFooter();

require( "/home/gps/public_html/include/core/append.php" );
?>

duggins
12-18-2003, 08:09 PM
here is the file prepend referenced in the above code


<?php
define( "SITE_CACHE_ENABLE", 0 );

define( "SITE_ROOT_PATH", "/home/gps/public_html" );
define( "SITE_INCLUDE_PATH", SITE_ROOT_PATH . "/include" );

define( "SITE_LAYOUT_HEADER", SITE_INCLUDE_PATH . "/layout/header.php" );
define( "SITE_LAYOUT_FOOTER", SITE_INCLUDE_PATH . "/layout/footer.php" );

define( "SITE_LAYOUT_AUTH_HEADER", SITE_INCLUDE_PATH . "/layout/header.auth.php" );
define( "SITE_LAYOUT_AUTH_FOOTER", SITE_INCLUDE_PATH . "/layout/footer.auth.php" );

define( "SITE_LAYOUT_XML_PATH", SITE_INCLUDE_PATH . "/xml" );

define( "SITE_CACHE_PATH", "/home/gps/public_html/www/cache" );

if( $PHP_SELF == "/district/calendar.php" || $PHP_SELF == "/edit/calendar.php" || $PHP_SELF == "/district/jobs.php" || $PHP_SELF == "/edit/jobs.php" )
{
if( $PATH_INFO )
{
// $PHP_SELF .= $PATH_INFO;
}
else
{
$PHP_SELF .= "/.";
}
}

$_SYSTEM[ "SCRIPT_NAME" ] = $_ENV[ "PATH_INFO" ];
$_SYSTEM[ "REQUEST_URI" ] = $_ENV[ "REQUEST_URI" ];
$_SYSTEM[ "PATH_INFO" ] = $_ENV[ "" ];
$_SYSTEM[ "QUERY_STRING" ] = $_ENV[ "QUERY_STRING" ];


/********************************************************************************/
/* CONTENT CACHING */
/********************************************************************************/

list( $PHP_SELF_NAME, $SCRIPT_ARGUMENTS ) = split( "\?", $PHP_SELF );
{
# print "[$SCRIPT_ARGUMENTS]\n";
}

if( !$SCRIPT_ARGUMENTS )
{
if( SITE_CACHE_ENABLE )
{
$DOCUMENT_INFO[ "cached_document" ] = SITE_CACHE_PATH . "/" . ereg_replace( "\/", "_", $PHP_SELF );

if( file_exists( $DOCUMENT_INFO[ "cached_document" ] ) )
{
$DOCUMENT_INFO[ "cache_mtime" ] = filemtime( $DOCUMENT_INFO[ "cached_document" ] );
$DOCUMENT_INFO[ "file_mtime" ] = filemtime( SITE_ROOT_PATH . $PHP_SELF );

$file_age = $DOCUMENT_INFO[ "file_mtime" ] - $DOCUMENT_INFO[ "cache_mtime" ];

if( $file_age >= SITE_CACHE_TIME )
{
$DOCUMENT_INFO[ "create_cache" ] = 1;
}
else
{
readfile( $DOCUMENT_INFO[ "cached_document" ] );

exit;
}
}
else
{
$DOCUMENT_INFO[ "create_cache" ] = 1;
}
}
}
else
{
$DOCUMENT_INFO[ "create_cache" ] = 1;
}

/********************************************************************************/

require( SITE_INCLUDE_PATH . "/parsers/navigation-new.php" );

$DOCUMENT_INFO[ "header_called" ] = 1;

ob_start();

function siteHeader()
{
global $DOCUMENT_INFO;
global $REMOTE_ADDR;

ob_start();

xmlTreeParser();

$navigation_tree = ob_get_contents();
ob_end_clean();

require( SITE_LAYOUT_HEADER );
}

function siteFooter()
{
require( SITE_LAYOUT_FOOTER );
}

function connectDatabase()
{
$database = pg_connect( "user=user password=password dbname=web" );

return $database;
}
?>

duggins
12-18-2003, 08:14 PM
here is the append file


<?php
$CACHED_DOCUMENT = ob_get_contents();

ob_end_clean();

if( $DOCUMENT_INFO[ "create_cache" ] )
{
ob_start();

$fp = fopen( $DOCUMENT_INFO[ "cached_document" ], "w" );
fputs( $fp, $CACHED_DOCUMENT );
fclose( $fp );

ob_end_clean();
}

print $CACHED_DOCUMENT;
?>

Spookster
12-18-2003, 08:25 PM
What was the error message?

duggins
12-18-2003, 09:44 PM
well it chugs along like its doing something but eventually this comes up

Parse error: parse error, expecting `']'' in /home/gps/public_html/include/core/prepend.php on line 59

Warning: main(SITE_LAYOUT_AUTH_HEADER): failed to open stream: No such file or directory in /home/gps/public_html/edit/login.php on line 4

Fatal error: main(): Failed opening required 'SITE_LAYOUT_AUTH_HEADER' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/gps/public_html/edit/log



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum