How can I run that function?
This is what I tried:
http.post("http://ccnet.ddns.me/php/core.php", "upload(\"test\", \"print(\"Hello world!\")\")")
(I got this from pastebin)
But it didn't work, does anyone know how?
http.post("http://ccnet.ddns.me/php/core.php", "upload(\"test\", \"print(\"Hello world!\")\")")
This topic may be of some use to you http://www.computerc...es-on-a-website
protected function upload($name, $data){
if($this->Write_Lock){
die("Write_lock");
}
$handle = fopen($this->UploadDirectory . basename($name), "w");
fwrite($handle,$data);
fclose($handle);
print("success");
}
Lua code:bump :C
Does anyone know how?
local function post(one,two)
http.post(
"http://website.extension/folder/post.php",
"one="..textutils.urlEncode(tostring(one)).."&"..
"two="..textutils.urlEncode(tostring(two))
)
end
post("testing", "123")
PHP code:
<?php
if(isset($_POST['one']) && isset($_POST['two'])){
$one = urldecode($_POST['one']);
$two = urldecode($_POST['two']);
echo "One: ".one."nTwo: ".two;
}
?>
"one="..textutils.urlEncode(tostring(two)).."&"..
"two="..textutils.urlEncode(tostring(one))
one = twoOops. Fixed.Well this is already pretty good.
Now you can make an if/switch-case block in PHP that compares $one with possible values and then executes the function.
Another way is using this http://php.net/manua...nction.eval.php function with $one / $two as a parameter.
Btw: I guess you made a little mistake here:one = two"one="..textutils.urlEncode(tostring(two)).."&".. "two="..textutils.urlEncode(tostring(one))
two = one ?????