Page 1 of 1

Oops, an error has occured

Posted: 09 Aug 2012, 20:13
by Mariomarco
Hey Guys,
I recently wanted to create an Manialink and now I'm stuck with the Authentication -.-
Here is the Code I've written:

Code: Select all

<?php
require_once 'libraries/autoload.php';

$player = new \Maniaplanet\WebServices\ManiaConnect\Player('mariomarco|Mm', 'xxxxxxxxx');
$player2 = $player->getPlayer();
echo'
<manialink version="1" background="0">
<timeout>0</timeout>';
if (!$player2) {

    $loginURL = htmlspecialchars($player->getLoginURL('basic'));
    echo'
 <label posn="0 -10 50" halign="center" valign="center" sizen="50 20" text="ENTER" manialink="'.$loginURL.'"/>
 ';
} else {

    

//Playerlogin und Nickname als variable speichern
$playerlogin = htmlspecialchars($player2->login);
$nickname = htmlspecialchars($player2->nickname); 

echo'
<label posn="0 -20 50" halign="center" valign="center" sizen="50 20" text="'.$playerlogin.'" />
';
}
echo'
</manialink>';
?>
[/size]

No Error code was given and the only thing the window is trying to tell me is to "Try again later" ,but that didn't work...

You can try it at:
Mariomarco?page=Connect

I wondered If my ws account got some Request and yes there are some :/

Pleaste help me :)

Re: Oops, an error has occured

Posted: 10 Aug 2012, 11:38
by gouxim
Instead of using htmlspecialchars to encode your data, use:

Code: Select all

htmlentities($data, ENT_QUOTES, 'UTF-8');