XML Includes in PHP causes Failure.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

First off, I'm posting this question for a friend that doesn't have
access to the news groups.

Using PHP as the base and has several  PHP < includes > for various
functions, all this by its self works just fine.

Failure occurs on adding the XML include.

Here's the wierd: If all the PHP includes are removed/commented out,
the XML includes work fine. As soon as you replace/uncomment the PHP
includes everything fails.  

Any Idea's would be greatly appreciated.


Re: XML Includes in PHP causes Failure.

Quoted text here. Click to load it

just an idea...

make sure the PHP-includes open with: <?php   and not just  <?

Re: XML Includes in PHP causes Failure.

Here are the code snippets of three pieces. The first is where the
problem comes in. When you uncomment the includes/DBConnector.php and
following lines, it fails.  

file: _enginGallerySvr.php

    function eventList($params){

//        require_once('includes/DbConnector.php');
//        $connector = new DbConnector();
//        require_once('includes/ImageManipulation.php');
//        require_once('includes/SystemComponent.php');
//        $settings = SystemComponent::getSettings();

        $dbstr="<div class='".$pSStyle->scalarval()."'>--


        return new xmlrpcresp(new xmlrpcval($dbstr,

    $s=new xmlrpc_server(array("wiplus.eventList" =>

array("function" => "eventList")));

file :SystemComponent.php
class SystemComponent {

var $settings;

function getSettings() {

// System variables
    $settings['uploadDir'] = '../../../';
// Main Collection Images
    $settings['thumbDir'] = 'imagethumbs/';
    $settings['imageDir'] = 'imagelib/';
// Web Gallery Thumbnails
    $settings['thumbDirWG'] = 'imagethumbs2/'; // High Res Images
    $settings['imageDirHR'] = 'imagelib2/'; // Member Profile
    $settings['imageDirPR'] = 'imagelib3/';

// Database variables
    $settings['dbhost'] = '';
    $settings['dbusername'] = 'myuser';
    $settings['dbpassword'] = 'mypassword';
    $settings['dbname'] = 'mydbname';

    return $settings;


file: DbConnector.php
// Class: DbConnector
// Purpose: Connect to a database, MySQL version
require_once 'SystemComponent.php';

class DbConnector extends SystemComponent {

var $theQuery;
var $link;

//*** Function: DbConnector, Purpose: Connect to the database ***
function DbConnector(){

    // Load settings from parent class
    $settings = SystemComponent::getSettings();

    // Get the main settings from the array we just loaded
    $host = $settings['dbhost'];
    $db = $settings['dbname'];
    $user = $settings['dbusername'];
    $pass = $settings['dbpassword'];

    // Connect to the database
    $this->link = mysql_connect($host, $user, $pass);
    register_shutdown_function(array(&$this, 'close'));


//*** Function: query, Purpose: Execute a database query *** function
query($query) {
    $this->theQuery = $query;
    return mysql_query($query, $this->link); }

//*** Function: getQuery, Purpose: Returns the last database query,
for debugging *** function getQuery() {
    return $this->theQuery;

//*** Function: getNumRows, Purpose: Return row count, MySQL
versi6*** function getNumRows($result){
    return mysql_num_rows($result);

//*** Function: fetchArray, Purpose: Get array of query results ***
function fetchArray($result) {
    return mysql_fetch_array($result);

//*** Function: close, Purpose: Close the connection *** function
close() {


On Tue, 19 Apr 2005 10:11:17 -0500, in comp.lang.php you wrote:

Quoted text here. Click to load it


Quoted text here. Click to load it

Site Timeline