XML Includes in PHP causes Failure.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Mowry

    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

  • Good Man

    #2
    Re: XML Includes in PHP causes Failure.

    Joe Mowry <jmowry@joment. com> wrote in
    news:k4k861thqj 4r0ojt1b10uidqf bl7q0quqb@4ax.c om:
    [color=blue]
    >
    > 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[/color]

    just an idea...

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



    Comment

    • Joe Mowry

      #3
      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: _enginGallerySv r.php
      <?php
      include("feed/xmlrpc.inc");
      include("feed/xmlrpcs.inc");

      function eventList($para ms){

      $pUserID=$param s->getParam(0);
      $pPassword=$par ams->getParam(1);
      $pType=$params->getParam(2);
      $pMaxWidth=$par ams->getParam(3);
      $pMaxHeight=$pa rams->getParam(4);
      $pQuality=$para ms->getParam(5);
      $pUseFixed=$par ams->getParam(6);
      $pFixedWidth=$p arams->getParam(7);
      $pFixedHeight=$ params->getParam(8);
      $pHStyle=$param s->getParam(9);
      $pSStyle=$param s->getParam(10) ;

      // require_once('i ncludes/DbConnector.php ');
      // $connector = new DbConnector();
      // require_once('i ncludes/ImageManipulati on.php');
      // require_once('i ncludes/SystemComponent .php');
      // $settings = SystemComponent ::getSettings() ;

      $dbstr="<div class='".$pSSty le->scalarval()."' >--
      SUCCESS
      --".$pUserID->scalarval(). "-".$pPasswor d->scalarval(). "</div>";

      //...

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

      $s=new xmlrpc_server(a rray("wiplus.ev entList" =>

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


      ?>
      ============
      file :SystemComponen t.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 'SystemComponen t.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_shutdo wn_function(arr ay(&$this, 'close'));

      }

      //*** Function: query, Purpose: Execute a database query *** function
      query($query) {
      $this->theQuery = $query;
      return mysql_query($qu ery, $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($res ult){
      return mysql_num_rows( $result);
      }

      //*** Function: fetchArray, Purpose: Get array of query results ***
      function fetchArray($res ult) {
      return mysql_fetch_arr ay($result);
      }

      //*** Function: close, Purpose: Close the connection *** function
      close() {
      mysql_close($th is->link);
      }


      }
      ?>


      On Tue, 19 Apr 2005 10:11:17 -0500, in comp.lang.php you wrote:
      [color=blue]
      >Joe Mowry <jmowry@joment. com> wrote in
      >news:k4k861thq j4r0ojt1b10uidq fbl7q0quqb@4ax. com:
      >[color=green]
      >>
      >> 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[/color]
      >
      >just an idea...
      >
      >make sure the PHP-includes open with: <?php and not just <?
      >
      >[/color]

      On Mon, 18 Apr 2005 20:39:08 -0400, Joe Mowry <jmowry@joment. com>
      wrote:
      [color=blue]
      >
      >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[/color]

      Comment

      Working...