Code:
<?php
function MUS($command, $data = '')
{
$MUSdata = $command . chr(1) . $data;
$socket = @socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
@socket_connect($socket, "bukehotel.nl", "30001");
@socket_send($socket, $MUSdata, strlen($MUSdata), MSG_DONTROUTE);
@socket_close($socket);
}
MUS("alert", $_SESSION['user']['id'] . " Je hebt je VIP ontvangen!");
?>
That *should* fix your issue.
Also, I'd like to point something out to make this function a little bit faster. I've noticed you're using 'bukehotel.nl' on this line:
Code:
@socket_connect($socket, "bukehotel.nl", "30001");
Every time an MUS request is sent to the server, PHP must first perform a DNS query. Which, in PHP is slow. I recommend using the servers IP address like so:
Code:
@socket_connect($socket, "123.456.789.101", "30001");