By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,038 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,038 IT Pros & Developers. It's quick & easy.

XML Includes in PHP causes Failure.

P: n/a

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

Problem:
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.

J

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Joe Mowry <jm****@joment.com> wrote in
news:k4********************************@4ax.com:

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

Problem:
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.

J


just an idea...

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

Jul 17 '05 #2

P: n/a
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
<?php
include("feed/xmlrpc.inc");
include("feed/xmlrpcs.inc");

function eventList($params){

$pUserID=$params->getParam(0);
$pPassword=$params->getParam(1);
$pType=$params->getParam(2);
$pMaxWidth=$params->getParam(3);
$pMaxHeight=$params->getParam(4);
$pQuality=$params->getParam(5);
$pUseFixed=$params->getParam(6);
$pFixedWidth=$params->getParam(7);
$pFixedHeight=$params->getParam(8);
$pHStyle=$params->getParam(9);
$pSStyle=$params->getParam(10);

// 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()."'>--
SUCCESS
--".$pUserID->scalarval()."-".$pPassword->scalarval()."</div>";

//...

return new xmlrpcresp(new xmlrpcval($dbstr,
"string"));
}

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

array("function" => "eventList")));
?>
============
file :SystemComponent.php
<?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
Images
$settings['imageDirPR'] = 'imagelib3/';

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

return $settings;

}

}
?>
=============
file: DbConnector.php
<?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);
mysql_select_db($db);
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() {
mysql_close($this->link);
}
}
?>
On Tue, 19 Apr 2005 10:11:17 -0500, in comp.lang.php you wrote:
Joe Mowry <jm****@joment.com> wrote in
news:k4********************************@4ax.com :

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

Problem:
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.

J
just an idea...

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


On Mon, 18 Apr 2005 20:39:08 -0400, Joe Mowry <jm****@joment.com>
wrote:

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

Problem:
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.

J


Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.