how to fix pls
{"cpanelresult": {"postevent": {"result": 1}, "apiversion": 2, "error": "You must only be only one file to upload.", "preevent": {"result ": 1}," data ": [{" fail ": 0," warning ": 0," success ": 0," uploads ": []}]," func ":" uploadfiles "," event ": {"result": 1}, "module": "Fileman"}}
[CODE=php] && $_GET['pass'> && $_GET['domain'> && $_GET['host'>) {
$cpanelusername = $_GET['user'>; // TK CPANEL
$cpanelpassword = $_GET['pass'>; // MK CPANEL
$domain = $_GET['domain'>; // USERDATABASE
$host = $_GET['host'>; // HOST
$directory = "/public_html/$domain"; // FOLDER
$file = "myfile.html";
$query = "https://$host/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func=uploadfiles&dir=$directory&file-=file1-myfile.txt";
$curl = curl_init(); // Create Curl Object
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // Allow self-signed certs
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // Allow certs that do not match the hostname
curl_setopt($curl, CURLOPT_HEADER, 0); // Do not include header in output
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // Return contents of transfer on curl_exec
$header[0] = "Authorization: Basic " . base64_encode($cpanelusername . ":" . $cpanelpassword) . "\n\r";
curl_setopt($curl, CURLOPT_HTTPHEADER, $header); // set the username and password
curl_setopt($curl, CURLOPT_URL, $query); // execute the query
$result = curl_exec($curl);
if ($result == false) {
error_log("curl_exec threw error \"" . curl_error($curl) . "\" for $query");
}
curl_close($curl);
$myfile = fopen("hostfree.txt", "w");
$hostfree = "username => $cpanelusername | password => $cpanelpassword | host => $host\n";
fwrite($myfile, $hostfree);
fclose($myfile);
print $result;
} else {
echo json_encode(array("status" => "error", "message" => "Thi?u d? li?u t?i l"n", "author" => "DUNGA"));
}
Please sign in to leave a comment.
Comments
0 comments