Well yes I a bit new to Php. So for my site i wanted to make a Highscore lookup for a game called runescape. This might be a little bit much for a new php coder espcially when you don't know anything about things like that. So I googled it. and i found a few things that posted highscore look up. Now on ever one that i found there always seemed to be an error and I can never figure out why here are the codes i found:
I found on another Lang sitei also have another code if you can't figure this out:

Found here: http://www.phphulp.nl/php/scripts/2/532/
PHP Code:
<?php

/**
 * RuneScapeStats class
 * 
 * Haalt de rankings van een runescapespeler uit de
 * hiscore-tabellen op www.runescape.com .
 * let op: de array die deze class geeft ziet er iets
 * anders uit dan die van de vorige versie. Onthoud
 * jezelf er vooral niet van om dit script te tweaken
 * naar je wensen.
 * 
 * @author Rolf de Jong, rolfthajong@gmail.com
 * @copyright Doe ermee wat je wilt, zolang deze header intact blijft! En een verwijzinkje is ook altijd leuk ;)
 *
 * @example 
$RS = new RuneScapeStats('Weed Tiger');
$RS->getSource();
$RS->parseArray();
$stats = $RS->getResult();

echo <<<HTML
<table>
    <tr>
        <td><b>Skill</b></td><td><b>Rank</b></td><td><b>Level</b></td><td><b>XP</b></td>
    </tr>
HTML;
foreach($stats as $values){
    echo "<tr>\n";
    echo '<td>'.$values['skill'].'</td>';
    echo '<td>'.$values['rank'].'</td>';
    echo '<td>'.$values['level'].'</td>';
    echo '<td>'.$values['xp']."</td>\n";
    echo "</tr>\n";
}
echo '</table>';

 */
class RuneScapeStats {
    
    
/**
     * Het domein van de runescape server
     * 
     * @access public
     * @var string
     */
    
var $server 'hiscore-web.runescape.com';
    
    
/**
     * De relatieve url om bij het juiste bestand 
     * op de server te komen
     * 
     * @access public
     * @var string
     */
    
var $relURL 'lang/en/aff/runescape/hiscorepersonal.ws';
    
    
/**
     * Gebruikersnaam van de speler waarvan de stats
     * opgevraagt moeten worden
     * 
     * @access public
     * @var string
     */
     
var $user;
    
    
/**
     * Dit is de variabele waar de verkregen data uiteindelijk
     * in wordt gezet
     * 
     * @access public
     * @var array
     */
    
var $statsArray;
    
    
/**
     * De skills waar een waarde bij gezocht moet worden
     *
     * @access public
     * @var array
     */
    
var $disciplines = array(
        
'Overall'
        
'Attack'
        
'Defence'
        
'Strength'
        
'Hitpoints'
        
'Ranged'
        
'Prayer'
        
'Magic'
        
'Cooking'
        
'Woodcutting'
        
'Fletching'
        
'Fishing'
        
'Firemaking'
        
'Crafting'
        
'Smithing'
        
'Mining'
        
'Herblore'
        
'Agility'
        
'Thieving'
        
'Slayer'
        
'Farming'
        
'Runecraft',
        
'Hunter',
        
'Construction');
    
/**
     * true als je debugmessages wilt weergeven, false zo niet
     *e
     * @var bool
     */
    
var $debug false;
    
    var 
$_httpBody "";
    var 
$_source;
    
    
/**
     * Constructor method; url-codeert de spelers naam
     * waarvan de stat opgezocht moeten worden
     *
     * @param string $user
     * @return void
     * @access public
     */
    
function RunescapeStats($user){
        
$this->user urlencode($user);
    }
    
    
/**
     * Haal de benodigde data van de server in html formaat
     * 
     * @return bool
     * @static false
     * @access public
     */    
    
function getSource()
    {
        
$this->addParam('user1'$this->user);
        
$this->addParam('submit''Search');
        
        
$fp fsockopen($this->server80$errno$errstr10);
        if(!
$fp){
            return 
false;
        }
        
        
$contentLen strlen($this->_httpBody);
        
$req = <<<REQUEST
POST /{$this->relURL} HTTP/1.1
Host: 
{$this->server}
Referer: http://
{$this->server}/{$this->relURL}
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 
{$contentLen}

{$this->_httpBody}
REQUEST;
        
fwrite($fp$req);
        
$stop false;
        while (!
$stop && !feof($fp)) {
            
$fetch fgets($fp128);
            
$this->_source.= $fetch;
            if(
strstr($fetch'This webpage') !== false){
                
fwrite($fp"Connection: close\r\n\r\n");
                
fclose($fp);
                
$stop true;
            }        
        }
        return 
true;
    }
    
    
/**
     * Zet alle stats in een array
     *
     * @static false
     * @access public
     * @return void
     */
    
function parseArray()
    {
        if (
strstr($this->_source"does not feature in the hiscores")) {
            
$this->statsArray false;
            return;
        }
        
        
$i 1;
        foreach (
$this->disciplines as $type) {
                 
//echo str_replace("\n", "", $this->_source);
            
if( eregi($type '</a></td><td align="right">([0-9\,]+)</td><td align="right">([0-9]+)</td><td align="right">([0-9\,]+)</td>'str_replace("\n"""$this->_source), $regs) ){
                
// De structuur van de array wordt hier gemaakt, en kun je hier dus ook aanpassen
                
$this->statsArray[$i]['skill']  = $type;
                  
$this->statsArray[$i]['rank'] = $regs[1];
                  
$this->statsArray[$i]['level'] = $regs[2];
                  
$this->statsArray[$i]['xp']    = $regs[3];
            } else {
                
$this->statsArray[$i]['skill']  = $type;
                
$this->statsArray[$i]['rank'] = 0;
                
$this->statsArray[$i]['level'] = 0;
                
$this->statsArray[$i]['xp']    = 0;
            }
            
$i++;
        }
    }
    
    
/**
     * Voeg een parameter toe aan de body
     *
     * @param string $name
     * @param string $value
     * @return void
     * @static false
     * @access public
     */
    
function addParam($name$value)
    {
        
strlen($this->_httpBody)<$this->_httpBody=$name.'='.$value $this->_httpBody.='&'.$name.'='.$value ;
    }
    
    
/**
     * Spuug de gevormde array uit
     *
     * @return array
     */
    
function getResult()
    {
        return 
$this->statsArray;
    }
    
    function 
execute()
    {
        if ( 
$this->getSource() ) {
            
$this->parseArray();
        } else {
            
$this->debug?trigger_error("Fout bij het ophalen van de source"):null;
            
$this->statsArray false;
        }
    }    
}

// Voorbeeldje, dit is de meest saaie toepassing van het script


echo '<form action="http://' $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'] . '" method="get">';
echo 
'Naam:&nbsp;&nbsp;&nbsp;<input type="text" name="naam" value="'.@$_GET['naam'].'" />';
echo 
'<br /><input type="submit" value="Zoek hiscores" />';
echo 
'</form><br />';


if(isset(
$_GET['naam'])){
    
$RS = new RuneScapeStats($_GET['naam']);
    
$RS->execute();
    
$stats $RS->getResult();

    if (
$stats != false// Als de naam niet in de hiscores voorkomt zal $stats false zijn, ander is $stats een array
    
{
        echo <<<HTML
<table>
    <tr>
        <td><b>Skill</b></td><td><b>Rank</b></td><td><b>Level</b></td><td><b>XP</b></td>
    </tr>
HTML;
        foreach(
$stats as $values){
            echo 
"<tr>\n";
            echo 
'<td>'.$values['skill'].'</td>';
            echo 
'<td>'.$values['rank'].'</td>';
            echo 
'<td>'.$values['level'].'</td>';
            echo 
'<td>'.$values['xp']."</td>\n";
            echo 
"</tr>\n";
        }
        echo 
'</table>';
    }
    else
    {
        echo 
"Naam niet gevonden in de hiscores";
    }
    
    
// var_dump($stats); unescape om de structuur van de array te zien
}
?>
so can anyone see whats wrong or whats the problem with them? Also does anyone know the lang so maybe i can translate the page with a web translater.

other code located here: (its in english: http://runearchives.net/derrick/?p=6)