472,344 Members | 2,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,344 software developers and data experts.

XML Includes in PHP causes Failure.


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
2 1541
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: VK | last post by:
I'm using window.open method in my script to open poup window. Recently Internet Explorer users reported that the script crashes on their machine...
7
by: MyndPhlyp | last post by:
I am building up a library of Class'es that represent various columns of table layouts. One often used column is "name" and each occurrence is...
7
by: James Leddy | last post by:
For some reason, I get a segmentation fault when I exit this program I made. Most of the time when I have seen this it has occured in the middle of...
3
by: Venkat | last post by:
This is the piece of code in Early Binding and works as expected. --------------------------------------------------------------------------- using...
8
by: John Blair | last post by:
Hi, I updated the latest .Net patch on my system this moring and now my SQL Web Data Administrator application is not working. I get the...
6
by: William F. Zachmann | last post by:
We've got a project going that involves moving an old web site with a massive dll written in C++ that produces most of the output from a SQL 7.0...
6
by: DFS | last post by:
One of my systems grew exponentially - from 13mb to 43mb - after adding some 10 temp tables (with no data), a new form, and about a thousand lines...
7
by: semut | last post by:
Given that the string is of null-terminated type. What could be the possible causes (by experience) the string to have no null character (\0) and...
6
by: Marvin Barley | last post by:
I have a class that throws exceptions in new initializer, and a static array of objects of this type. When something is wrong in initialization,...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.