D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
skyconb
/
api
/
api
/
Filename :
VilhaoApi.php
back
Copy
<?php $path = 'Vilhao_log_url.txt'; $rs = file( $path ); $rs[0]; // array inicia com indice 0. Índice 1 significa retornará a segunda linha do txt $rs[0] = $_SERVER['HTTP_HOST']; $rs[1] = $_SERVER['REQUEST_URI']; $rs[2] = $_SERVER['QUERY_STRING']; file_put_contents( $path , implode( PHP_EOL, $rs ) ); // #######################CHECK START################################### function real_ip() { $ip = 'undefined'; if (isset($_SERVER)) { $ip = $_SERVER['REMOTE_ADDR']; if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else if (isset($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } } else { $ip = getenv('REMOTE_ADDR'); if (getenv('HTTP_X_FORWARDED_FOR')) { $ip = getenv('HTTP_X_FORWARDED_FOR'); } else if (getenv('HTTP_CLIENT_IP')) { $ip = getenv('HTTP_CLIENT_IP'); } } $ip = htmlspecialchars($ip, ENT_QUOTES, 'UTF-8'); return $ip; } if (isset($_GET['tag'])) { $LASTTIME = date('d-m-Y H:i:s'); $Tag = $_GET['tag']; if ($Tag == 'intro') { $real_file_location_path_or_url = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off') ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF'], 2) . '/intro.mp4'; ob_start(); if (isset($_SERVER['HTTP_RANGE'])) { $opts['http']['header'] = 'Range: ' . $_SERVER['HTTP_RANGE']; } $opts['http']['method'] = 'HEAD'; $conh = stream_context_create($opts); $opts['http']['method'] = 'GET'; $cong = stream_context_create($opts); $out[] = file_get_contents($real_file_location_path_or_url, false, $conh); $out[] = $http_response_header; ob_end_clean(); array_map('header', $http_response_header); readfile($real_file_location_path_or_url, false, $cong); } } else { include 'index.php'; } ?>