Send commands to Phoenix via PHP

Status
Not open for further replies.

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
Hello,

I remember in UberCMS you used to be able to send Hotel alert's from the ASE.
I tried to re-create it, but I can't seem to get it working.

Can anyone see anything wrong with my code?

PHP:
<?php
$fp = fsockopen("udp://127.0.0.1", 1232, $errno, $errstr);
if (!$fp) {
    echo "ERROR: $errno - $errstr<br />\n";
} else {
    fwrite($fp, ":ha Hello!");
    echo fread($fp, 1232);
    fclose($fp);
}
?>
 

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
Not sure, how would I re-create a user sending a hotel alert?
I tried to send it directly to the emu but it doesn't seem to be working.
 

Artixius

Member
Nov 16, 2011
53
9
You almost had it, this is taken from a CMS I coded, I modified it a bit though.

PHP:
<?php
 
function MUS($command, $data = '')
{
$MUSdata = $command . chr(1) . $data;
$socket = @socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
@socket_connect($socket, "127.0.0.1", "30001");
@socket_send($socket, $MUSdata, strlen($MUSdata), MSG_DONTROUTE);
@socket_close($socket);
}
MUS("ha", "This is a test hotel alert!");
 
?>

I suggest putting that in your core.php or global.php file that is included throughout every page, the MUS("ha") line is just for testing purposes. So the usage would be like so:

PHP:
<?php
 
MUS("command", "data");
 
?>

Search the web for all the MUS commands, I know there's about 20.

EDIT: Also remember to adjust the IP and port depending on your configuration.
 

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
-- I don't see anything on the actual client, but in Phoenix, I get "Connection Dropped"
 

ItsNick

Member
Nov 19, 2013
96
15
You also need to make sure the server can handle such commands. Search for something like MusSocket.cs, or similar... it will have a list of commands you can run through MUS.
 
Status
Not open for further replies.

Users who are viewing this thread

Top