Example ManiaLink [You have to change the path to the script at two positions in the script]:
Code: Select all
<?php
$param = htmlspecialchars(isset($_GET['param'])? $_GET['param'] : '', ENT_QUOTES, 'UTF-8');
header('Content-Type: text/xml;charset=utf-8');
echo <<<EOT
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<manialink version="1" background="0">
<entry id="entry" name="inputParam" sizen="100 5" />
<label id="label" posn="0 -10" style="CardButtonMediumWide" text="Send! (using ManiaScript)" ScriptEvents="1" />
<label posn="0 -20" style="CardButtonMediumWide" text="Send! (using classic method)" manialink="http://localhost/test.php?param=inputParam" />
<label posn="0 -30" textcolor="000F">{$param}</label>
<script><!--
while(True) {
foreach(Event in PendingEvents) {
if (Event.Type == CGameManialinkScriptEvent::Type::MouseClick && Event.ControlId == "label") {
declare Text Link = "http://localhost/test.php?param=";
Link ^= (Page.GetFirstChild("entry") as CGameManialinkEntry).Value;
log("OpenLink: " ^ Link);
OpenLink(Link, ::LinkType::ManialinkBrowser);
}
}
yield;
}
--></script>
</manialink>
?>
If you click on "Send! (using ManiaScript)", the called URL is with wrong encoding. Instead of having it urlencoded, it appears in ISO-8859-whatever.
If you click on "Send! (using classic method)", the link is called correctly, so its not a Server fault.