Hi. I wanna run code using 'curl'. I wrote below, but couldn't run. Displayed codes in console directory. So didn't run code. How can i fix this? PHP: $curl = curl_init("http://example.com/example.php");curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);$response = curl_exec($curl);$this->getLogger()->info($response);curl_close($curl); example.php written: $this->getLogger()->notice("now testing"); $this->getLogger()->info("Testing"); thank you for reading my thread, and answering.
this is the pocketmine forum and why do you need to run code from a website? anyway , you can try: PHP: $code=file_get_contents('http://ex.com/example.html');eval($code);//file_get_contents() return a string //eval() evaluate the php code //http://php.net/manual/en/function.eval.php//for more info about eval use Google
Use Utils::getURL() and Utils:ostURL() directly. They are in the class pocketmine\utils\Utils 1. That would normally not work with HTTPS 2. Never ever eval unverified code from external sources. In that way, if one day by some accidents the external source got hacked or the DNS got seized by someone else, you are exposing your whole system's vulnerability. A possible safer (but not safest) solution is to use a checksum to validate the code, but in that case, why don't you simply embed the code into the plugin?