Hello dear phphelp team.
As i am in the specific section, you should be able to guess that i am a beginner!
id like to read out some highscores from a game called runescape.
[code=php] <?php
//
$RS = new RuneScapeStats(‘Bulletfight2’);
$RS->getSource();
$RS->parseArray();
$stats = $RS->getResult();
echo <<<HTML
’;
Skill
Rank
Level
XP
HTML;
foreach($stats as $values){
echo “n”; n”;
echo ‘’.$values[‘skill’].’
’;
echo ‘’.$values[‘rank’].’
’;
echo ‘’.$values[‘level’].’
’;
echo ‘’.$values[‘xp’].“
n”;
echo “
}
echo ‘
//
class RuneScapeStats {
var $server </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'hiscore.runescape.com'</span><span class="syntaxkeyword">;
var $relURL </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'hiscorepersonal.ws'</span><span class="syntaxkeyword">;
var $user;
var $statsArray</span><span class="syntaxkeyword">;
var $disciplines </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> array</span><span class="syntaxkeyword">(
‘Overall’,
‘Attack’,
‘Defence’,
‘Strength’,
‘Hitpoints’,
‘Ranged’,
‘Prayer’,
‘Magic’,
‘Cooking’,
‘Woodcutting’,
‘Fletching’,
‘Fishing’,
‘Firemaking’,
‘Crafting’,
‘Smithing’,
‘Mining’,
‘Herblore’,
‘Agility’,
‘Thieving’,
‘Slayer’,
‘Farming’,
‘Runecraft’,
‘Hunter’,
‘Construction’);
var $debug = false;
var $_httpBody = “”;
var $_source;
function RunescapeStats</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$user</span><span class="syntaxkeyword">){
$this->user = urlencode($user);
}
</span>[/code]
is what i have for now.
I cant get, why it doesnt work… anyways, mayby someone “pro” is able to teach me, what i did wrong…