executePHP
executePHP
Originally created for archcry, executePHP enables players to type a command along with a code which will execute an external PHP script somewhere on your website. This is great for server owners that want their players to verify their Minecraft account, with their website/forums account.
Features
- Easy and simple to configure.
- Can be used for simple to very complex tasks.
- Automatic update notifier.
- Customisable return messages.
Commands
- /executePHP - Shows the executePHP help page.
- /executePHP reload [executePHP.reload] - Reloads the executePHP configuration file.
- /verify <code> [executePHP.verify] - Will trigger the external PHP script with the optional variables.
Variables
Here are the variables you can use when defining your executePHP URL in the configuration file.
- %username% - The username of the player who executed the command.
- %code% - The code that the player entered with the command.
- %uuid% - The UUID of the player who executed the command.
Have more ideas for variables? Suggest them in a ticket! (Not the comments)
Configuration Guide
#executePHP Configuration File #Should executePHP check for updates on startup? Recommended to keep this at true. checkUpdate: true #The URL to submit the request to. URL: http://localhost/executePHP?name=%username%&code=%code% #The message displayed to the player when waiting for a response. verifyingMessage: '&bVerifying your code, please wait...' #This is the results section. You can have as little results as you want, or as much as you want. results: success: '&aSuccessfully verifed code!' incorrect: '&cIncorrect code!' already-verified: '&6You have already verifed your code.' error: '&4We seroiusly have no idea.'
Example PHP Script
<?php if (!empty($_GET['username']) && !empty($_GET['code'])){ $name = $_GET['username']; $code = $_GET['code']; switch ($code){ case "sugar": echo "success"; break; case "milk": echo "incorrect"; break; case "wheat": echo "already-verified"; break; default: echo "error"; break; } } else { echo "Error: No URL Variables."; } ?>
executePHP includes an automatic update feature. You can disable this in the global Updater configuration, or in executePHP's configuration file.
Planned Features
The following are planned features of executePHP. If you have any suggestions, please submit them in a ticket!
- PHP script will run async. (Helps performance.)
- Timed out feature. (If the php script doesn't respond in x seconds, the plugin will throw an error no matter what.)
- Return commands. (Run commands based on the return value.)
@Mcdefault
How did you run it in 1.8+ ?
Waiting for 1.8 support :D great plugin
EDIT:
actually works great in 1.8!
and also: you may specify that this mod doesnt acually open your browser. I thought that first.
This plugin looks promising. We are looking for something similar. Would you consider implementing an in-game scheduler so you can schedule a script to run at a certain in-game time, for example: dawn.
Also would you consider running local php files on a server instead of fetching a URL? So for example run local command: "php /var/scripts/myscript.php"
Thank you for your consideration.
@FoxyFullmoon
I've updated the project description to include the new UUID variable, thanks!
@nxtguy
Wonderful! Works beautifully. Although I might suggest updating your variables section for others in the future, as I had to use my "smarts" and guess what the uuid variable might be ;)
@FoxyFullmoon
Apologies for the late response. The latest release, executePHP v1.1 now also sends the player's UUID. :)
It would be really useful if this plugin had the ability to send UUID in the same way it sends the name and code. I'm wanting to code a guaranteed method to sync my website with their minecraft accounts and it seems a feature like that would make it the easiest way to get their UUID without the question of the name changing feature.
@robbo5899
Yep! https://github.com/nxtguy/executePHP
Feel free to submit pull requests if you like. :)
Hey is the source code available?
@Acrynios_
The example PHP script is just something I quickly made to test the plugin. I've uploaded it to pastebin here: http://pastebin.com/E0uK8SmP
However, if you want a more realistic example you should look at Archcry's original topic requesting this plugin. It includes a more realistic PHP script example: http://forums.bukkit.org/threads/verify-account.163919/
Hello,
Is it possible that someone could recreate a plain text PHP example script for me please, since my text editor doesn't seem to want to copy/paste the above example script, and all attempts to recreate it has ended in fails.
Thanks in advance!
Really looking forwardto the next version of this plugin :D
@DJTomek
Websend does PHP - Bukkit very well. However, there isn't really a simple way to do Bukkit - PHP. executePHP is great for servers who want to get their players to verify their website/forum's account as when you execute the command you need to also specify a code.
Why this plugin and not websend for example?
Awesome plugin to make sure the people that apply for your whitelist are who they say they are :D Thanks for making this plugin, it really helps me alot as my website host blocks database connections from external IP's
~ Archcry