Jump to content

hi can u pls help me out in this...


ravindranadh

Recommended Posts

well i just started to use php...and while i did established the data base connection succesfully.... but when i was tryin to go through the pages , some of the pages are been displaying as

 

Fatal error: Class 'xsltprocessor' not found in C:\wamp\www\dvdmania.com\view_category.php on line 119with out displaying the content of the page....

 

can u please suggest me about that ... thnx in advance..

 

Link to comment
https://forums.phpfreaks.com/topic/44094-hi-can-u-pls-help-me-out-in-this/
Share on other sites

code of the php page that is throwin the error...

 

$xml_data.="</cp788ecommerce>";

//die ($xml_data);

//Create new XML DOM document

$xml = new DomDocument;

//Load XML from the string

$xml->loadXML($xml_data) or die ("Unable to load XML string");

//Create new XSL DOM document

$xsl = new DomDocument;

$xsl->load('xml/products.xsl');

 

//Configure the transformer

$proc = new xsltprocessor;

$proc->importStyleSheet($xsl); // attach the xsl rules

 

print $proc->transformToXML($xml); // actual transformation

//*** END  Process xsl stylesheet and XML document together

?>

<!-- END PHP PART -->

 

yeah it had the code include_once

 

this is the whole php code...

 

<?php

include_once "include/user_header.php";

//include config file which contains DB vars needed for mysql connection

include_once "include/config.php";

//connect to database

$conn = mysql_connect($HOST,$USER,$PASS) or die("Unable to connect as $USER to $DB");

mysql_select_db($DB,$conn) or die ("Unable to select $DB database");

 

$result = mysql_query("SELECT a.*,b.name category_name FROM Products a,categories b

where a.category_id=b.id

and a.category_id=".$_GET[id]) or die("Unable to execute query");

$rcount = mysql_num_rows($result);

if($rcount < 1)

die("The are no products in this category");

      $xml_data.= "<?xml version=\"1.0\" ?>\n";

  //create the root element

  $xml_data.= "<cp788ecommerce>\n";

 

  //Loop for each row in the result set

  //Fetch data in the associative array with key=>value e.g. artist=>Madonna

  while($row = mysql_fetch_assoc( $result) ){

    $xml_data.=" <products>\n";

    //Loop for each array element

    foreach($row as $key=>$val)

    $xml_data.= "\t<$key>$val</$key>\n";

    $xml_data.=" </products>\n";

}//End of while

$xml_data.="</cp788ecommerce>";

//die ($xml_data);

//Create new XML DOM document

$xml = new DomDocument;

//Load XML from the string

$xml->loadXML($xml_data) or die ("Unable to load XML string");

//Create new XSL DOM document

$xsl = new DomDocument;

$xsl->load('xml/products.xsl');

 

//Configure the transformer

$proc = new xsltprocessor;

$proc->importStyleSheet($xsl); // attach the xsl rules

 

print $proc->transformToXML($xml); // actual transformation

//*** END  Process xsl stylesheet and XML document together

?>

<!-- END PHP PART -->

 

thnx for u r help ... :)

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.