Re: PHP and XML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm not sure you are going about this the right way. It's my impression that you may not yet have learned the basics of XML. Really, the very basics are quite simple. For your address book, for instance, you could create a simple XML structure such as this:

<ENTRY>
    <FIRST_NAME></FIRST_NAME>
    <LAST_NAME></LAST_NAME>
    <ADDRESS_1></ADDRESS_1>
    <ADDRESS_2></ADDRESS_2>
    <STATE></STATE>
    <COUNTRY></COUNTRY>
    <POSTAL_CODE></POSTAL_CODE>
    <PHONE_NUMBER></PHONE_NUMBER>
    <FAX></FAX>
    <ADDITIONAL></ADDITIONAL>
</ENTRY>

Then write a script which fills in the data.

1. Start out with the document root:
        echo "<ENTRY>";
2. Fill in the data:
	echo "<FIRST_NAME>$first_name</FIRST_NAME>";
	echo "<FIRST_NAME>$last_name</FIRST_NAME>";
   And so forth.

3. Finish off with the document root:
        echo "</ENTRY>";

You can include the XML header once at the top of your file:
	<?xml version="1.0">


You don't need a special class or set of third-party functions to do a simple task like this. You can easily write your own, and it will parse with any XML parser.


Myron

onewaylife wrote:

Hello Edward
Just i don't  now where to start.


Edward Kay wrote:
Hello,

You say that you are "unable to store the files in XML". Why is this? Are
you getting an error message or do you just not know where to start?

Edward

Dear All

I am novice in PHP & XML, while trying I am creating a small application
i.e. Address Book.
In this I am using Apache2, PHP5 and XML no database is used. I have FC5
machines. but I am unable to store the files in XML. If any one
share their
experience in this by providing Examples or tutorials etc...
So far I have found tutorial related to porting the information
of data from
MySQL to XML and then php with help of DOM.

Thanks
onewaylife
--
View this message in context:
http://www.nabble.com/PHP-and-XML-tf2692397.html#a7507917
Sent from the PHP - General mailing list archive at Nabble.com.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--

_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux