Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Jul 2009
    Posts
    17
    Thanks
    4
    Thanked 0 Times in 0 Posts

    domxml error php

    i get an error for the following code in which i am trying to append to an xml file with data from the data base. I get the error only when i upload the file to my host 1and1 and on my local system i donot have any problems.

    Code:
    <?php
    include('../mysql.php');
    $obj=new db();
    $obj->connect();
    $qry="select order_id from orders";
    $res=$obj->query($qry);
    while($newarray=$obj->fetch($res))
    {
    $orders[]=$newarray['order_id'];
    }
     
       
      $doc = new DOMDocument(); 
      $doc->formatOutput = true; 
       
      $r = $doc->createElement( "orders" ); 
      $doc->appendChild( $r ); 
       
      for($i=0;$i<sizeof($orders);$i++)
      { 
      $b = $doc->createElement( "order" ); 
       
      $num = $doc->createElement( "num" ); 
      $num->appendChild( $doc->createTextNode( $orders[$i] ) ); 
      $b->appendChild( $num ); 
       
      $r->appendChild( $b ); 
      } 
       
      echo $doc->saveXML(); 
      $doc->save("orders.xml") 
    ?>
    I googled as much as i could and found out that the
    extension=php_domxml.dll {for windows}
    extension=php_domxml.so {for linux}

    must be commented out in the php.ini file.

    i did that as well and uploaded my own version of the php.ini file on the root and the directory from where i was calling this code, but no luck....

    does any one know what the issue is, AM I USING FUNCTIONS OR STANDARDS WHICH HAVE BEEN DEPRECATED.

    Im using linux hosting by the way.

    following is the error that i get.

    Code:
    Fatal error: Call to undefined method: domdocument->createelement() in /homepages/39/d284887719/htdocs/admin/OFS/includes/dataset/write_orders.php on line 16
    Last edited by niladhar; 08-25-2009 at 06:49 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •