Jump to content

PHP files in webbrowser


dudeks

Recommended Posts

The PHP interpreter is running on the webserver and MTA as a client can thus not execute PHP.

Instead, you can use Javascript to execute an event:

HTML/Javascript:

<script> 
    function executeMyEvent() { 
        // Execute MTA event 
        mta.triggerEvent("myEvent", 1, 2, 3) 
    end 
</script> 
<a onclick="executeMyEvent()">Click to trigger the event</a> 

Lua:

addEvent("myEvent") 
addEventHandler("myEvent", myBrowser, 
    function(a, b, c) 
        -- The following line outputs "1, 2, 3" to the chat 
        outputChatBox(string.format("%d, %d, %d", a, b, c)) 
    end 
) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...