What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Include XML ?

Pages: (2): « First [ 1 ] 2 » Last »
Include XML ?
Author: Message:
Eddie
Veteran Member
*****


Posts: 2078
Reputation: 30
32 / Male / Flag
Joined: Oct 2005
Status: Away
O.P. Include XML ?
Is there a way i can include this into my website "http://www.habbo.com.au/habbo_count_xml.action" *-) I've googled but can't figure it out. :(

P.S. I want to include that url (xml in it) into my website *-)

This post was edited on 04-16-2007 at 09:45 AM by Eddie.
...there used to be a signature here :)
04-16-2007 09:45 AM
Profile PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: Include XML ?
<?php
include('http://www.habbo.com.au/habbo_count_xml.action');
?>

I doubt it will work beccause it's on a different server but give ti a try
Touch Innovation - touch friendly programs/applications for the windows mobile!


04-16-2007 10:06 AM
Profile E-Mail PM Web Find Quote Report
Eddie
Veteran Member
*****


Posts: 2078
Reputation: 30
32 / Male / Flag
Joined: Oct 2005
Status: Away
O.P. RE: Include XML ?
quote:
Originally posted by Nathan
<?php
include('http://www.habbo.com.au/habbo_count_xml.action');
?>

I doubt it will work beccause it's on a different server but give ti a try
i figured it out :) but thanks anyway (Y)
...there used to be a signature here :)
04-16-2007 10:10 AM
Profile PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: Include XML ?
Do you want to include the XML file, or split it up into various variables to use in your own way? Because you will need to do it differently to your current method. If that is the case I'll gladly explain how to do it in detail :).
04-16-2007 12:40 PM
Profile PM Find Quote Report
Eddie
Veteran Member
*****


Posts: 2078
Reputation: 30
32 / Male / Flag
Joined: Oct 2005
Status: Away
O.P. RE: Include XML ?
quote:
Originally posted by absorbation
Do you want to include the XML file, or split it up into various variables to use in your own way? Because you will need to do it differently to your current method. If that is the case I'll gladly explain how to do it in detail :).
if you look at that file, all i want to be shown is the number, and i have to link to that file for the number to come up, but if you think there is a good way then please let me know :)
...there used to be a signature here :)
04-16-2007 01:05 PM
Profile PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: Include XML ?
Then your way is fine just to show a number. If you want to take the number and use it for something else, you would need to use a different method :P.
04-16-2007 01:17 PM
Profile PM Find Quote Report
Eddie
Veteran Member
*****


Posts: 2078
Reputation: 30
32 / Male / Flag
Joined: Oct 2005
Status: Away
O.P. RE: Include XML ?
This is the method im using...

code:
<?php
$data = file_get_contents("http://www.habbo.com.au/habbo_count_xml.action") or die("Could not get data");
$data = trim(strip_tags($data));
echo $data;
?>

is that correct?
...there used to be a signature here :)
04-17-2007 04:28 PM
Profile PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: Include XML ?
That's fine for the the value you want. If you want to really dig into a RSS feed, PHP offers a variety of functions specific to the task.

Using your way is totally fine for what you are doing ;)

P.S: What are you using it for, it seems a little random [Image: zippydrogo.gif]
04-17-2007 04:33 PM
Profile PM Find Quote Report
Eddie
Veteran Member
*****


Posts: 2078
Reputation: 30
32 / Male / Flag
Joined: Oct 2005
Status: Away
O.P. RE: Include XML ?
Official Habbo Australia Fansite, and im wanting to show how many Habbo's are online the hotel :) And thanks (Y)

This post was edited on 04-17-2007 at 04:46 PM by Eddie.
...there used to be a signature here :)
04-17-2007 04:46 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Include XML ?
It's probably not the most recommended way, but in this case it should do. :)

A more 'professional' way, using regular expressions, would be:
code:
<?php
$data = file_get_contents("http://www.habbo.com.au/habbo_count_xml.action") or die("Could not get data");
$usercount = preg_replace("/<usercount>([0-9]+)<\\/usercount>/", "\\1", $data);
echo $data;
?>
Or, if your server has PHP 5 or higher installed, you can use the SimpleXML functions or the XML Reader object to read the XML file.

EDIT: Am I really that slow or are you too fast? :S

This post was edited on 04-17-2007 at 04:49 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
04-17-2007 04:47 PM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On