PlusEMU MUS + PHP

Blasteh

big tits
Apr 3, 2013
1,156
521
Hey,
So I recently got sockets/MUS commands working in my emulator and housekeeping. It's currently 3am and I've been working on this for the past four hours (not this exact shit) but, I want the alert to input what the textbox says. How would I get it so it sends what the users inputs in this textbox? I'm tired as fuck and going to bed, but I'm literally stumped.

You must be registered for see images attach


PHP:
<?php
    // MUS COMMAND
    if(isset($_POST['hotel_alert']))
    {
        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", "12345"); // Change to proper IP/MUS Port
             @socket_send($socket, $MUSdata, strlen($MUSdata), MSG_DONTROUTE);   

             @socket_close($socket);
         }
         MUS("hotel_alert", "".$alert."");
    }
    
    // HOTEL ALERT
    $auth->update_Location($_SERVER['REQUEST_URI']);
    if(!$auth->permission("hk.hotel_alert"))
    {
        $auth->log_Action("NONE","hotel_alert","Access denied");
        $nopage = 1;
    }
        else
    {
        echo "
        <div class='page-header'><h1>Hotel Alert</h1></div>
        <p>Here you may send a hotel alert. Please, <b>do not</b> include your username. It will automatically be added.</p>
        <form method='post'>
            <fieldset>
                <div class='clearfix'>
                    <label for='hotel_message'>Message</label>
                    <div class='input'>
                        <input type='text' id='hotel_message' name='hotel_alert' style='width: 400px' maxlength='250' onkeydown='if (event.keyCode == 13) MUS();'>
                    </div>
                </div>
            </fieldset>
            <div class='actions'>
                <input class='btn primary' type='submit' name='hotel_alert' value='Send' />
                <input class='btn' type='reset' value='Clear' />
            </div>
        </form>";
    }
?>
 

Attachments

  • upload_2018-2-27_3-1-52.png
    upload_2018-2-27_3-1-52.png
    17.7 KB · Views: 7

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,396
I don't see anywhere that accesses the POST data directly, besides ensuring it's checked. Forgive me if I'm wrong but perhaps changing $MusData to
PHP:
             $MUSdata = $command . chr(1) . $_POST['hotel_alert'];
will provide better results.
 

Blasteh

big tits
Apr 3, 2013
1,156
521
I don't see anywhere that accesses the POST data directly, besides ensuring it's checked. Forgive me if I'm wrong but perhaps changing $MusData to
PHP:
             $MUSdata = $command . chr(1) . $_POST['hotel_alert'];
will provide better results.
I’ll test that out in the morning, thanks baby cakes
 

JynX

Posting Freak
Feb 6, 2016
710
438
PHP:
MUS("hotel_alert", "".$alert."");
$alert isn't defined in the snippet above..

Edit: Try this.. I'd also suggest putting the function for MUS someone more accessible incase you use MUS in other places in your HK..
PHP:
<?php
    // MUS COMMAND
    if(isset($_POST['hotel_alert']))
    {
        $alert = $_POST['hotel_message']; // I would suggest sanitizing this
        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", "12345"); // Change to proper IP/MUS Port
            @socket_send($socket, $MUSdata, strlen($MUSdata), MSG_DONTROUTE);   
            @socket_close($socket);
        }
        MUS("hotel_alert", $alert);
    }
    
    // HOTEL ALERT
    $auth->update_Location($_SERVER['REQUEST_URI']);
    if(!$auth->permission("hk.hotel_alert"))
    {
        $auth->log_Action("NONE","hotel_alert","Access denied");
        $nopage = 1;
    }
        else
    {
        echo "
        <div class='page-header'><h1>Hotel Alert</h1></div>
        <p>Here you may send a hotel alert. Please, <b>do not</b> include your username. It will automatically be added.</p>
        <form method='post'>
            <fieldset>
                <div class='clearfix'>
                    <label for='hotel_message'>Message</label>
                    <div class='input'>
                        <input type='text' id='hotel_message' name='hotel_message' style='width: 400px' maxlength='250'>
                    </div>
                </div>
            </fieldset>
            <div class='actions'>
                <input class='btn primary' type='submit' name='hotel_alert' value='Send' />
                <input class='btn' type='reset' value='Clear' />
            </div>
        </form>";
    }
?>
 
Last edited:

Users who are viewing this thread

Top