not loading

Discussion in 'PHP' started by promotingspace.net, Aug 19, 2007.

  1. #1
    hi
    i coded a software that was working fine last week. but i noticed that none of it's php fines is working. the pages are not loading. see this url for example
    i was confused and thought maybe the php softwares on the server are not running properly, so tested a php file:
    working.php:
    <?php
    echo "php is working";
    ?>
    and you see it's working: click here to see
    this software also uses pear and mysql codes
    can you guess any reason?
     
    promotingspace.net, Aug 19, 2007 IP
  2. alexts

    alexts Well-Known Member

    Messages:
    1,126
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    Digital Goods:
    1
    #2
    cen you be more specific or post some example code.
     
    alexts, Aug 19, 2007 IP
  3. promotingspace.net

    promotingspace.net Peon

    Messages:
    361
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    in almost all of the pages that are not loaded (but were loading already) (like http://textly.fr/login.php ) this code is used on the top:
    include 'global.php';
    and global.php is:
    <?php
    /* $Id: global.php,v 1.65 2002/09/20 08:57:24 shaggy Exp $ */
    session_start(); // keep above lib/user.php and functions.php
    require_once 'functions.php';
    require_once '../config.php'; // before session_defaults
    require_once 'session_defaults.php';
    require_once 'lib/user.php';
    include 'error.php';
    $db = db_connect();
    $user = new User($db);
    ?>
    PHP:
     
    promotingspace.net, Aug 19, 2007 IP
  4. promotingspace.net

    promotingspace.net Peon

    Messages:
    361
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    and config.php is:
    <?php
    
    function handlePearError($error) {
    	header('HTTP/1.0 500 Internal Server Error');
    	//die("$error->message<br />$error->userinfo"); // uncomment this to debug
    	die('Error ocurred, please try again later');
    }
    
    
    function &db_connect() {
    	require_once 'DB.php';
    	$dsn = "mysql://root:@unix+localhost/adsense";
    
    	$db = DB::connect($dsn);
    
    	if (DB::isError($db)) {
    		die("Database connection failed.");
    	}
    
    	$db->setFetchMode(DB_FETCHMODE_OBJECT);
    	$db->setErrorHandling(PEAR_ERROR_CALLBACK, 'handlePearError');
    	
    	return $db;
    }
    ?>
    PHP:
     
    promotingspace.net, Aug 19, 2007 IP