Mordent
Jul 25 2008, 05:38 PM
| | So I was idly pondering my next PHP venture today - more on that if/when I get it done - when I realised I needed to be able to read some data in from files. Sure, I could use simple binary files (each line having the relevant data on it, etc. etc.), but I figured I'd might as well learn how to use this snazzy XML stuff I keep hearing about.
So, after looking at W3Schools for a bit I couldn't find an obvious way of reading XML files in PHP. There was plenty of information of how to do it in JavaScript, but as I want to read the files in on the server rather than with the client's browser that's not much help. After searching on php.net I realised there was way more XML related stuff than I was ready for, so quite simply I'd like to know if it's possible to read XML files in using PHP (and specifically: on AstaHost), how I go about it and any other little snippets of information you have on XML and PHP.
Thanks in advance!
Mordent |
Reply
toby
Jul 25 2008, 06:12 PM
There's millions of classes for this. Personally, I'd make my own, but I think this is the biggest one. http://uk3.php.net/simplexml
Reply
Mordent
Jul 25 2008, 07:03 PM
Ah, perfect. Got to love how it's called SimpleXML, although damned if I spotted that when trawling through search results.  Cheers!
Reply
Recent Queries:--
xmldata insert mysqltable - 99.31 hr back. (1)
Similar Topics
Keywords : reading, xml, data, php
- Hard Drive Data Recovery Review
(7)
Skydrive
5 gigs for saving your data (9) I just received a mail from the Messenger team, talking about skydrive. Seems very interesting,
it's supposed to be a krypted area where you store important things (a copy of your passport
before traveling, who knows). It's a great idea having copy of your important things. And, of
course, 5 gigs storage is always someting interesting. Have a look, it's here :
http://skydrive.live.com ....
Java And Sql: Data Mismatch
(6) Alright, I'm having some really funky issue with this. I know it's a mismatch (obviously)
and I want to know if the Astahost community members can help me solve this issue. It's been
annoying me a lot of late. CODE try{ libSQL myAddNewData = new libSQL(); String
strRownum =(String.valueOf(jComboBoxLName.getSelectedItem())); if (intChoice == 1){
myAddNewData.AddNewData("INSERT INTO CUSDATA (FIRSTNAME, LASTNAME, PHONE, SIN) VALUES
('"+ strUserData +"','" + strUserData + "','" + strUserData + "&....
Basic Forensics: Winhex
Reading sectors on a mounted disk/storage volume (1) WinHex is a hexadecimal editor that allows you to read sectors on a mounted volume with support for
FAT, NTFS, Ext2/3, ReiserFS, Reiser4, UFS, CDFS, UDF file systems. The basic program is available
free for download, although there are levels of licenses that can be obtained for to unlock
additional features. These include their individual licenses Personal ($56.00), Professional
($105.00), Specialist ($255.00) and X-Ways Forensics ($929.00) which cover the cost for one (1)
license of its type. In the world of IT, a tool like WinHex comes in quite handy when working wit....
Rss And Xhtml From The Same Data
A simple way (0) You may have heard of methods to transform RSS feeds into XHTML by the means of an XSLT stylesheet,
but there are a few problems with that method that I've found. I've encountered that if you
choose to publish RSS, it won't read the XSLT stylesheet for some strange reason, and if you get
it to output XHTML, it doesn't detect the RSS. So therefore, it is a complicated way to get
that to work. Instead, this is a simpler way. What you will need: An PHP/XML file An XSLT
stylesheet It isn't that hard and I will go through both of these with you thro....
Letting Users Add Mysql Data With Php
(1) I'm curious as to the best methods of letting users submit data to a MySQL database, displaying
that data, and removing any unwanted tags etc. from it. Currently, there's a handful of PHP
functions that I know of to help with this: mysql_real_escape_string() - perhaps the best known
and most commonly used function, it should be used in pretty much any MySQL query. It escapes
characters that have SQL significance. QUOTE(php.net) ...which prepends backslashes to the
following characters: \x00, \n, \r, \, ', " and \x1a I like to think I made a pretty....
Was My Site Data Copied By Someone?
Same index page (6) I just found this site: asta-killer dot com and as you can see, it's a copy of mine index on
astahost: http://qzone.astahost.com the strange thing is that when you enter something like:
asta-killer dot .com/list/ a directory or file which doesn't exist, you get an error, but the
error is from my php script on astahost.. So that means that that index file isn't only copied
html, but also somehow they got my php source? what a hell is that? then OK I thought it is a remote
thing, but it's impossible on my account to get such an error at all, because th....
Reading Files And Folders
(1) I am in the process of writing a small content management system for my niche sites and need to be
able to accomplish the following two items. Any assistance would be appreciated: I have a
directory that has nothing but sub directories in it and I need to be able to identify each
directory name and return them in an option drop down selection menu which will be included in an
identifying URL. ALSO: I am in need of a script that could be included on a returned page
that will read the content of a table and identify various keywords within the content and pl....
Generator
An online data generator script (2) Generator is an online tool written in Javascript, PHP and MySql for use in testing software,
populating databases, etc. that generate very quickly custom data in various formats like HTML, SQL,
or XLS. It's free, open source and very easy to use. About Generator Generator Online
Download and Installation instructions of the Data Generator Script Best regards,....
Getting Certain Parts Of A Record
The character data (17) Ok I need help on this puzzling problem. At first I thought that this person stored the dates in the
MySQL database like this: August 27, 2007 That kinda freaked me out a little, because string dates
are hard to manipulate. Then I found out that he stored both th string data and numerical date,
which I found a little bit odd, but it was like this: 2007-08-27 I need to build a PHP program to
manipulate the data, but I need to access the year, month and day respectively by themselves. I
think that isolating the first 4 characters for the year, last 2 characters for da....
The Battle For Your Online Data
(0) This an article entitled "Google, Microsoft and Apple building online storage havens: you win" I
just found on digg. http://arstechnica.com/news.ars/post/20070...ns-you-win.html My comments: -
Yes, I suspected that ever-growing gmail storage space wouldn't last forever. Caveat: check this
out: "Gmail Going Huge: 9000MB+" http://mashable.com/2007/08/09/gmail-going-huge-9000mb/ - They
can promise you 50 GB of online storage, but if they are going to impose limits on the file size,
that's going to make the whole thing worthless. - I'll be sticking with m....
Reformatted Hard Disk
need to get old data back (5) I have a hard disk that had been running XP Pro and I accidentaly mixed it up with an empty disk,
reformatted it, and installed Windows XP over. But I now realize I had tons of important information
on it, and aside from kicking myself for my stupidity, I'd like to recover the files, if at all
possible. What software would be recommended to start with? something that can read from a
reformatted disk, but that isn't too expensive -- even freeware, if there is such a robust free
product -- with a decent chance of recovery. The files were NTFS, with simple Admin sec....
Entering Data In Mysql
(3) Hello every one, When using enterprise manager with MS SQL server, we get a very good interface to
enter information at design time. i.e. Initial population of database. MySQL administrator does not
have such a support. If any one knows an administration client that makes that easy, please tell me
it will be of great help. I can design a small application for that my self but I want some
professional kind of application with ever thing in. SQL server enterprise manager is a good
example. Although i don't like its interface in general. Regards Haris Mushtaq....
Data Base For Online Games
(0) Iam thinking of starting an online game, I have some knowledge in PHP and C++ skills. But I am still
new to mysql. I have 2 things to ask, the first is a bit of topic but does this sight allow me to
host a game?. 2, how do i make a data base. You know units hp, attack and other characteristics. +
people making acounts (sign up by email and verify) and all other things. Can any one help me?
/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />....
Sql Injection Prevention (passing Numerical Data Across Pages).
PHP/mySQL (9) Even if your building something as simple as a basic news page for your website, if your passing
along url variable strings like (mysite/index.php?page=1), you may be vulnerable to SQL injection
attacks. For cases like these (passing numerical data in url strings), I have a handy dandy little
function to thwart these attempts silly: CODE // For checking if value is a number, if not
return 1. function isNum($val) { if (!is_numeric($val)) { $val = 1; } return ($val); } I
have this function, within my functions.php file, which I use as an include in files w....
Data Recovery
what should i use? (15) I sent a computer in for a motherboard replacement. I could have done it myself, but i figured why
not save some time. The computer came back from the shop with not only the motherboard replaced, but
the hard drive reformatted and windows reinstalled as well. After yelling at the guy for his
stupidity, I've now settled down to try to recover the lost data. The problem with what i'm
using (R-studio) is that it will recover a formatted partition, but because windows has been
installed again on top it only sees that one. What are my chances of recovering the data, a....
Problems With Php Saving Data Into Mysql
HELP! I can't get my php documents to work with the mySQL (6) i have a server that says it allows php and mysql and in the control panel i can access mysqladmin
and phpmyadmin but i cant get the php to save data into the mysql, i am trying to make a text-based
MMOG so i need to save my users/passwords into a database(i thought) and it won't do it, can
anyone help me....
Data That Can Be Visualized Can't Be All Bad
(1) Do you have some data that is worthwhile but getting old and musty? Why not pick a Data
Visualization method and watch people flock to view it. It is called Infosthetics where the sky is
the limit to using your imagination. Some examples are Baby Name Voyageur where you can have fun
using a Web 2.0 graph that gives you the popularity of a name depending on the year you choose.
With blue streams being boy names and pink streams being girl names a soon-to-be parent would have a
lot of fun picking out a new name. Another dynamic source of data visualization is digg l....
Share Data Between Your Cell, The Web & Your Im
Send a GAD (2) Check this out .... QUOTE If only I had a penny every time I wished that I could grab some
piece of necessary info. (phone numbers, appointments etc.) off the web and have it readily
available in my cell or instant messenger... or simply post some SMS that came on my mobile and
acess it through my browser later on... I'd probably get as close to a billionaire as one can
get The current technological trend suggests that we're heading towards a major
convergence of software and services for both mobiles & desktop systems. And following up on th....
Games For Samsung D900
Install games with data cable (3) Hello everyone. I have a problem and perhaps you can help me out? I have a samsung d900 and I want
to install games using a data cable. Does anyone know how to do it? Thanks in advance!....
Using Leading Zeros And Sorting Data
Sort data correctly (2) The Importance Of Using Leading Zeros Leading zeros are a very important tool for
sorting and comparing data on computers. What is a leading zero? A leading zero does just what it
sounds like, it leads the value. For example, lets convert a few numbers to leading zero numbers to
make the new number 5 digits long. 234 => 00234 456 => 00456 6456 => 06456 12 => 00012 4 => 00004
677 => 00677 That's great right but why would you do that? This is done for 2 reasons
actually. The first is to display numbers in a more uniform and easier to read form....
Internet Through Data Cable
(8) hi guys, I use internet a lot. I am currently using internet via dial-up connection. I am planning
to activate internet on my mobile phone. What shall i be needing to use internet on my computer
using the mobile connection. I have seen that some people access internet using bluetooth. Does the
use of data cable reduces the speed of internet. Kindly supply your valuable comments on how should
i go about accessing internet using a mobile phone. Waiting for reply. ....
MS Excel -- Automatic Update Of Data
(3) I've got a cell that contains a number, and it is likely for hat number to increment or
decrement itself on a ragular basis. Could someone briefly explain how it would be made for the
number to adjust automatically? For example, lets say that that cell is driven by a database, if I
import data from a database, and then the information in the db changes, will Excel adjust
accordingly? Please help -- I'm really stuck on this. It's part of some coursework I'm
doing and I'm desperate for an answer.....
[PHP + MySQL] Encrypting Data
To protect the password of your DB, for example. (11) Hi! This is my 2nd code of PHP + MySQL. This code is VERY simple: it encript the data in the MySQL
DB. Here we go! ------------------------------------------------------------------------ CODE
$password = "abc"; $new_password = md5($password); echo $new_password; ?> The password "abc"
was codfied using md5() This will be: 900150983cd24fb0d6963f7d28e17f72 CODE $normal_pass =
"abc"; $encripted_pass = "900150983cd24fb0d6963f7d28e17f72"; if(md5($normal_pass) ==
$encripted_pass) echo "Login Sucessful!"; else echo "Incorrect password."; ?> This c....
Convert Fat32 To Ntfs Without Data Loss (dos-mode)
(8) Some computer's are sold with windows XP pre installed and with FAT32 FORMAT, so there is a way
to change it without data loss. Go do MS-DOS and type convert c: /fs:ntfs, dont forget to change
the drive c:\, d:\ , e:\ for the one that you wanna convert . PS : This process is impossible
to return to FAT32, once you convert you can't turn back , unless you format your pc
/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> cheers m8's
/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> ....
DVD/CD-RW Combo Drive Help: Not Reading DVDs
I need help with my dvd drive (13) Hey all I need some help and advice, Lately my DVD/CD-RW Combo Drive has been seeming up: I put
in a CD, Works fine. I Put in a DVD and the drive spins and the light comes on, but nothing
happens, i go my computer and it shows the drive is empty. Is it dieing on me or what is going on?....
10 Gb Data Storage For Free!
Amazing site for online data storage (54) Here is a cool site i could found which has amazing facility to store upto 10 GB data online! I can
also send any file through email to any person for free! Isnt sounds coooool?? here is the url
http://www.streamload.com Enjoy... /smile.gif' border='0' style='vertical-align:middle'
alt='smile.gif' /> ....
Disaster Recovery
How not to lose important data. (14) To begin with I was a Boy Scout. The Boy Scout motto is: "Always Be Prepared." That being said,
most of this article is about how to prevent data loss. The very first thing I do is partition the
primary hard drive into at least two partitions. 10 to 15 GB for the operating system (C:\) and the
remainder for personal data (D:\) If possible, use two hard drives instead of two partitions. Most
computer problems come about from corrupt data, conflicting settings, or misconfigurations in the
operating system. As a result, most problems can be fixed by simply reformating....
Php, Sql Lite: Storing Session's Data?
how so store session in SQLITE? (1) normally, in windows, session data is saved in the location as directed by the "session.save_path"
directives. they only show how to store session data in file. is it possible to store it inside the
SQLite? anyone?....
Embedded Database
Embedded Data base at client side, (7) Hi, Now its the era of Embedded databases, no more db servers, no more host,Because with embedded
db you can get all those options, what you are used to get with DB Servers. Some of Embedded DB Are
1) Cloudscape From IBM (NOW Derby from ASF) 2) HSQLDB (OpenSource) and many more Feel the power of
EDB Cheers Arunkumar.H.G....
Looking for reading, xml, data, php
|
*SIMILAR VIDEOS*
Searching Video's for reading, xml, data, php
|
advertisement
|
|