Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: error somewhere

  1. #1
    New Coder
    Join Date
    Dec 2003
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error somewhere

    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

    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" );
    ?>

  • #2
    New Coder
    Join Date
    Dec 2003
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here is the file prepend referenced in the above code
    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;
    	}
    ?>

  • #3
    New Coder
    Join Date
    Dec 2003
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here is the append file
    Code:
    <?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;
    ?>

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    What was the error message?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #5
    New Coder
    Join Date
    Dec 2003
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •