@ 2014-05-22T01:20:41Z <?PHP
// ini_set('max_execution_time', 6000);
// flush();
// ob_flush();
// ------------------------- DB SETUP ------------------
$dbhost = 'faradaypromo.com:3306';
$dbuser = 'priceles_kst';
$dbpass = 'kst33';
$dbname = 'priceles_kst';
$conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
if ($conn->connect_error) {
trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR);
}
// ------------------------- READ LIST -------------------
$wlist = "http://faradaypromo.com/aggr_dom2.txt";
$handle = fopen($wlist, "r");
if ($handle) {
while (($line = fgets($handle)) !== false) {
pinger($line);
}
} else {
// error opening the file.
echo "file io error";
}
fclose($handle);
// ----------------------------FUNCTIONS -------------------
function pinger($ws){
$ch = curl_init();
$options = array(
CURLOPT_URL => $ws,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 1,
CURLOPT_TIMEOUT_MS => 500,
CURLOPT_MAXREDIRS => 10,
CURLOPT_NOSIGNAL => 1
);
curl_setopt_array( $ch, $options );
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo date('H:i:s')." - ".$ws." ".$httpCode."/n";
if ( $httpCode == 200 ){
write_sql($ws, $httpCode);
}
curl_close($ch);
}
function write_sql($ws, $code){
$sql = "INSERT INTO websites (cat,uri,status, time) VALUES ('$wlist','$ws',$code,NOW())";
if($conn->query($sql) === false) {
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);
} else {
$last_inserted_id = $conn->insert_id;
$affected_rows = $conn->affected_rows;
echo " - ok: id ".$last_inserted_id;
}
}
mysql_close($conn);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 Fatal error: Uncaught Error: Class "mysqli" not found in /in/vjYdl:11
Stack trace:
#0 {main}
thrown in /in/vjYdl on line 11
Process exited with code 255 . Output for 7.0.0 - 7.0.20 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 Fatal error: Uncaught Error: Class 'mysqli' not found in /in/vjYdl:11
Stack trace:
#0 {main}
thrown in /in/vjYdl on line 11
Process exited with code 255 . Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.28 Fatal error: Class 'mysqli' not found in /in/vjYdl on line 11
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.9 Fatal error: Cannot instantiate non-existent class: mysqli in /in/vjYdl on line 11
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Fatal error: Cannot instantiate non-existent class: mysqli in /in/vjYdl on line 11
preferences:dark mode live preview
323.21 ms | 401 KiB | 398 Q