PHP combined with XML, XSLT, and MySQL _php tutorial

Source: Internet
Author: User
Tags pear xsl file xslt
A combination of PHP and XML, XSLT, MySQL, installation
Often see the user asked some of the PHP and XML, database combined with the use of posts, also often see some beginners
The PHP code and HTML code mixed together, and then in the wrong time to find the error, the rush to round, I will give big
Home how to use XML technology to separate the HTML code from the PHP program, of course, there are many separate techniques, such as pear
The IT template.
In general, I think that the use of XML technology is the most convenient, nonsense, we have to talk about,
Tell me about the installation under the Win2000.

Using XML and XSLT in PHP to use some DLL libraries,
Extension=php_domxml.dll//function library for manipulating XML
Extension=php_iconv.dll//transcoding, such as the?????? Turn into a UTF-8.
Extension=php_xslt.dll//xslt's Library of functions

With these three libraries, you will add the DLLs directory in the PHP installation directory to the path, or you will not find
Of these class libraries

In the following course, we will use the PHP Pear Class Library, the main use of DB Class Library, Sql2xml class library, you can
Pear.php.net Download the latest version
After downloading the above two class library, we'd better set up in php.ini
include_path = ".; D:phppear "

D:phppear is the installation path of my pear

After setting up, restart the machine, or because the path can not be found to cause Apache boot is not normal to use


It is not easy to use the XML and XSLT settings in PHP at this point.
Users who use Linux can go to
http://www.gingerall.com/Download the source code about XSLT
Http://www.gnu.org/software/libicon ... About the source code of ICONV

Two PHP and XML, XSLT, MySQL, the use of a combination of primary articles
What I'm going to talk about is a simple process of extracting data from a database, generating an XML document, and using XSLT to transform into HTML.
This process only speaks of the process of using this technology and does not involve paging and other technologies

The example I use the following database tables and data
Table Name: Enterprise User Information Form, English name: yhxx
Table structure:
#
# The structure of the data table ' Yhxx '
#

CREATE TABLE Yhxx (
NSRNM varchar (+) not NULL default ' ',
QYMC varchar (+) not NULL default ' ',
Qydh varchar (+) not NULL default ' ',
PRIMARY KEY (NSRNM)
) Type=myisam comment= ' User Information Form ';

#
# Data Sheet content ' yhxx '
#

INSERT into Yhxx VALUES (' 310109040111985 ', ' Joe Home Diet Development Limited ', ' 8621-63346626 ');
INSERT into Yhxx VALUES (' 310104040221736 ', ' Shanghai Jialing Trading Co., Ltd. ', ' 74292546 ');
INSERT into Yhxx VALUES (' 310108040331576 ', ' Emerald Art Company ', ' 54861465 ');


Next I started writing the data Extraction program and the page that displayed the data.
In order for everyone to understand, I use the simplest way to write a program

program file name: browesdata.php
Page file name: browesdata.html
Program and page file to provide download, this program has been tested under Win2000, MySQL
Code See next page


If you are interested in this technology, let me tell you about PHP and XML, XSLT, database combined with a deeper step of the application

?>
GetMessage ()); Connection failure, output error message
}

The following two is a public function
/**
* Read XSL Document
*
* @param String $filename The name of the-xsl file
* @return String

http://www.bkjia.com/PHPjc/631887.html www.bkjia.com true http://www.bkjia.com/PHPjc/631887.html techarticle a combination of PHP and XML, XSLT, MySQL, installation of the article often see the user asked some of the PHP and XML, database combined with the use of posts, but also often see some beginners to the PHP code with ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.