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

Question...
Author: Message:
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
RE: Question...
code:
$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;
Shows the number of users.

code:
$data = @file_get_contents("http://www.habbo.com.au/habbo_count_xml.actionaa") or die("Could not get data");
$usercount = preg_replace("/<usercount>([0-9]+)<\\/usercount>/", "\\1", $data);
echo $data;
(Notice the aa at the end of the URL, bumming it up). This works as it should for me. (ie, Could not get data is sent to the browser).

Notice the @ in front of file_get_contents - this disables warnings. (Edit: For that function).

You could also do (as the last line):
echo ($data) ? $data : "No Data";

This post was edited on 07-03-2007 at 10:02 AM by andrewdodd13.
[Image: AndrewsStyle.png]
07-03-2007 10:01 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Question... - by Eddie on 07-02-2007 at 12:25 PM
RE: Question... - by MeEtc on 07-02-2007 at 03:20 PM
RE: Question... - by user13774 on 07-02-2007 at 08:26 PM
RE: Question... - by andrewdodd13 on 07-03-2007 at 10:01 AM
RE: Question... - by Eddie on 07-04-2007 at 07:22 AM


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