Jump to content

PHP files in webbrowser


dudeks

Recommended Posts

Posted

Hello.

How to use local php files in web browsers? .php extension is not allowed in meta.xml file, is other way to use it?

Need to be local for executing events from browser in client.

Posted

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 
) 

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...