Oops, an error has occured

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

Post Reply
Mariomarco
Posts: 52
Joined: 23 Jul 2012, 16:02

Oops, an error has occured

Post 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 :)
Last edited by Mariomarco on 23 Sep 2012, 02:47, edited 1 time in total.
Image
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: Oops, an error has occured

Post by gouxim »

Instead of using htmlspecialchars to encode your data, use:

Code: Select all

htmlentities($data, ENT_QUOTES, 'UTF-8');
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
Post Reply

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 1 guest