473,465 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1595
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 with different runtime errors. See the bug:...
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 treated identically. (What a concept, eh?) Part of...
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 the program and the program terminates. However,...
3
by: Venkat | last post by:
This is the piece of code in Early Binding and works as expected. --------------------------------------------------------------------------- using ControlLicenseService LicenseInfoClient lic =new...
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 following error: Server Application Unavailable 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 data base on NT4 onto IIS on Windows 2003 Server...
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 of code. The .mdb has mostly table links, lots of...
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 cause buffer overflow later. I know it is quite...
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, CGI program crashes miserably. Debugging shows...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.