Zitat von KQBeast
Beitrag anzeigen
Ankündigung
Einklappen
Keine Ankündigung bisher.
cURL Request
Einklappen
Neue Werbung 2019
Einklappen
X
-
So, es kommen jetzt 2 Fehler, danke aufjedenfall schonmal für jeden der mir bis jetzt geholfen hat. Allerdings weiß ich nicht was die mir aussagen sollen. Da in diesen beiden Zeilen gar keine URL gesetzt ist.
PHP-Code:Notice: No URL set! in /home/vol9_2/freezoy.com/frzoy_ID/htdocs/test.php on line 49
Notice: in /home/vol9_2/freezoy.com/frzoy_ID/htdocs/test.php on line 79
PHP-Code:if(!$loginResponse) {
// Generate Script-Error from cURL-Error
trigger_error(curl_error($ch));
}
PHP-Code:if(!$minerCreationResponse) {
// Generate Script-Error from cURL-Error
trigger_error(curl_error($ch));
}
Kommentar
-
Hallo,
hab das gerade mal debuggt - das lag daran das "array_merge" die vereinten Arrays durchnumeriert also eine fortlaufende Nummer als Index baut. Habe es erneut im vorheringen Post aktualisiert.
Edit: Das was du in der Zeile siehst ist das Error-Handling damit wir überhaupt wissen was los ist außer "bool(false)"!Gruß,
SebTM
Kommentar
-
PHP-Code:<?php
function getip() {
$ip;
if (getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} else if(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} else if(getenv("REMOTE_ADDR")) {
$ip = getenv("REMOTE_ADDR");
} else {
$ip = "UNKNOWN";
}
return $ip;
}
//all strings by programm
$PCName = $_GET['Name'];
$GPU = $_GET['GPU'];
$CPU = $_GET['CPU'];
$WD = $_GET['Windows'];
$AT = $_GET['Architecture'];
$UN = $_GET['Username'];
$IP2 = getip();
$se = "INSERT INTO users (`GPU`, `CPU`, `Windows`, `Architecture`, `Username`, `IP`, `Workername`) VALUES ('$GPU', '$CPU', '$WD', '$AT', '$UN', '$IP2', '$PCName')";
$se2 = "CREATE TABLE IF NOT EXISTS `users` (
`GPU` varchar(255) NOT NULL default 'UNKNOWN',
`CPU` varchar(255) NOT NULL default 'UNKNOWN',
`Windows` varchar(255) NOT NULL default 'UNKNOWN',
`Architecture` varchar(255) NOT NULL default'UNKNOWN',
`Username` varchar(255) NOT NULL default 'UNKNOWN',
`IP` varchar(255) NOT NULL default 'UNKNOWN',
`Workername` varchar(255) NOT NULL default 'UNKNOWN'
)";
//connect database
$db = new mysqli("server", "user", "passwort");
$db->select_db("db");
$db->query($se2);
$db->query($se);
//counter
$datei = fopen("counter.txt","r+");
$counterstand = fgets($datei, 10);
if($counterstand == "") {
$counterstand = 0;
}
$counterstand++;
rewind($datei);
fwrite($datei, $counterstand);
fclose($datei);
// Enable Error-Reporting
error_reporting(-1);
ini_set('display_errors', 1);
// Check if cURL is installed & enabled
if (!function_exists('curl_version')) {
die('<b>Error:</b> PHP-cURL is not installed or disabled!<br>');
}
// Create cURL-Handle
$ch = curl_init();
// Set array with default cURL-Options
$defaultOptions = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
CURLOPT_POST => true,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_COOKIEJAR => 'cookie.txt'
);
// Set array with default Post-Fields
$defaultPostFields = array(
'username' => 'email',
'password' => 'passwort'
);
// Set data for Login-Request
curl_setopt_array(
$ch,
($defaultOptions + array(CURLOPT_URL => 'https://hamsterpool.com/index.php?page=login', CURLOPT_POSTFIELDS => $defaultPostFields))
);
// Execute cURL-Request for Login
$loginResponse = curl_exec($ch);
// Check for error
if(!$loginResponse) {
// Generate Script-Error from cURL-Error
trigger_error(curl_error($ch));
}
$defaultPostFieldsMiner = array(
'username' => $PCName,
'password' => 'password'
);
// Set data for creation of Miner
curl_setopt_array(
$ch,
($defaultOptions + array(
CURLOPT_URL => 'https://hamsterpool.com/index.php?page=account&action=workers',
CURLOPT_POSTFIELDS => ($defaultPostFieldsMiner + array(
'page' => 'account',
'action' => 'workers',
'do' => 'add',
'ctoken' => ''
)
)
)
)
);
// Execute cURL-Request for creation of Miner
$minerCreationResponse = curl_exec($ch);
// Check for error
if(!$minerCreationResponse) {
// Generate Script-Error from cURL-Error
trigger_error(curl_error($ch));
}
// Close cURL-Handle
curl_close($ch);
$db->close();
?>
Kommentar
-
Zitat von lstegelitz Beitrag anzeigenDann auch mal einen Blick in die Logfiles riskieren...
Kommentar
-
Zitat von SebTM Beitrag anzeigenFrag den Support deines Anbieters wo die Logfiles einsehbar sind bzw. ob!
Kommentar
Kommentar