3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $id = ''.$_GET['id'].''; // roger-dickie/a3/a78/946 ?> <?php $url = 'http://www.mfinante.ro/infocodfiscal.html?cod='.$id.'';//an=WEB_AN2014&cod='.$id.''; $curl_header = array('X-Requested-With: XMLHttpRequest', 'Content-Type: application/x-www-form-urlencoded','Connection: Keep-Alive'); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36" ); curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_header); //curl_setopt($ch, CURLOPT_PROXY, '124.202.183.66:8118'); $data = array('cod' => $id, 'php_master' => true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_REFERER, 'http://www.mfinante.ro/infocodfiscal.html?cod=299'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS,$data); // number="$cprno" curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE); curl_setopt($ch, CURLOPT_VERBOSE, true); $source = curl_exec($ch); curl_close($ch); ?> <?php $DOM = new DOMDocument; libxml_use_internal_errors(true); if (!$DOM->loadHTML('<?xml encoding="utf-8" ?>' . $source)) { $errors=""; foreach (libxml_get_errors() as $error) { $errors.=$error->message."<br/>"; } libxml_clear_errors(); print "libxml errors:<br>$errors"; return; } $xpath = new DOMXPath($DOM); $name = $xpath->query('//*[@id="main"]/center[1]/table/tr[1]/td[2]')->item(0); if (!is_object($name)) { return; } $address = $xpath->query('//*[@id="main"]/center[1]/table/tr[2]/td[2]')->item(0); $county = $xpath->query('//*[@id="main"]/center[1]/table/tr[3]/td[2]')->item(0); $commercialno = $xpath->query('//*[@id="main"]/center[1]/table/tr[4]/td[2]')->item(0); $actauthorization = $xpath->query('//*[@id="main"]/center[1]/table/tr[5]/td[2]')->item(0); $postalcode = $xpath->query('//*[@id="main"]/center[1]/table/tr[6]/td[2]')->item(0); $phone = $xpath->query('//*[@id="main"]/center[1]/table/tr[7]/td[2]')->item(0); $fax =$xpath->query('//*[@id="main"]/center[1]/table/tr[8]/td[2]')->item(0); $yearregistered = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[9]/td[2]')->item(0); $observations = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[10]/td[2]')->item(0); $dateoflaststatement = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[11]/td[2]')->item(0); $lastprocessing = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[12]/td[2]')->item(0); $corporationtax = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[13]/td[2]')->item(0); $enterpriseincometax = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[14]/td[2]')->item(0); $excise = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[15]/td[2]')->item(0); $vat = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[16]/td[2]')->item(0); $socialinsurancecont = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[17]/td[2]')->item(0); $insurancecontri = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[18]/td[2]')->item(0); $unemploymentinsurance = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[19]/td[2]')->item(0); $gauranteefund = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[20]/td[2]')->item(0); $healthinsurance = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[21]/td[2]')->item(0); $leavesandindemnity = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[22]/td[2]')->item(0); $gamblingtax = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[23]/td[2]')->item(0); $taxonincome = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[24]/td[2]')->item(0); $constructioncorporation = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[25]/td[2]')->item(0); $taxoncrude = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[26]/td[2]')->item(0); $miningroyalties = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[27]/td[2]')->item(0); $oilroyalties = $xpath->query('//*[@id="content"]/div[@id="main"]/center/table/tr[28]/td[2]')->item(0); ?> <?php /*?><?php mysql_query("INSERT INTO peoplenew SET personname='$personname', countryofresidence='$countryofresidence', dateofbirth='$dateofbirth', nationality='$nationality' , OCCUPATION1='$OCCUPATION1', COMPANYNAME='$COMPANYNAME', LINK='$LINK', POSITION='$POSITION', OCCUPATION='$OCCUPATION', APPOINTED='$APPOINTED', STATUS='$STATUS', ACTUALURL='$ID'") OR DIE(MYSQL_ERROR()); ?>}<?PHP */?> </TBODY> </TABLE> <?PHP MYSQL_CONNECT("127.0.0.1", "ROOT", "") OR DIE(MYSQL_ERROR()); MYSQL_QUERY("SET NAMES UTF8;"); MYSQL_QUERY("SET CHARACTER_SET UTF8;"); MYSQL_SELECT_DB("TEST") OR DIE(MYSQL_ERROR()); ?> <?PHP ECHO 'ID:'.$ID.'</BR>'; ECHO 'NAME:'.$NAME->TEXTCONTENT.'</BR>'; ECHO 'ADDRESS:'.$ADDRESS->TEXTCONTENT.'</BR>'; ECHO 'COUNTY:'.$COUNTY->TEXTCONTENT.'</BR>'; ECHO 'COMMERCIAL NO:'.$COMMERCIALNO->TEXTCONTENT.'</BR>'; ECHO 'ACT AUTHORIZATION:'.$ACTAUTHORIZATION->TEXTCONTENT.'</BR>'; ECHO 'POSTAL CODE:'.$POSTALCODE->TEXTCONTENT.'</BR>'; ECHO 'PHONE:'.$PHONE->TEXTCONTENT.'</BR>'; ECHO 'FAX:'.$FAX->TEXTCONTENT.'</BR>'; ECHO 'YEAR REGISTERED:'.$YEARREGISTERED->TEXTCONTENT.'</BR>'; ECHO 'OBSERVATIONS:'.$OBSERVATIONS->TEXTCONTENT.'</BR>'; ECHO 'DATE OF LAST STATEMENT:'.$DATEOFLASTSTATEMENT->TEXTCONTENT.'</BR>'; ECHO 'LAST PROCESSING:'.$LASTPROCESSING->TEXTCONTENT.'</BR>'; ECHO 'CORPORATION TAX:'.$CORPORATIONTAX->TEXTCONTENT.'</BR>'; ECHO 'ENTERPRISE INCOME TAX:'.$ENTERPRISEINCOMETAX->TEXTCONTENT.'</BR>'; ECHO 'EXCISE:'.$EXCISE->TEXTCONTENT.'</BR>'; ECHO 'VAT:'.$VAT->TEXTCONTENT.'</BR>'; ECHO 'SOCIAL INSURANCE:'.$SOCIALINSURANCECONT->TEXTCONTENT.'</BR>'; ECHO 'INSURANCE CONTRIBUTIONS:'.$INSURANCECONTRI->TEXTCONTENT.'</BR>'; ECHO 'UNEMPLOYMENT INSURANCE:'.$UNEMPLOYMENTINSURANCE->TEXTCONTENT.'</BR>'; ECHO 'GUARANTEE FUND:'.$GAURANTEEFUND->TEXTCONTENT.'</BR>'; ECHO 'HEALTH INSURANCE:'.$HEALTHINSURANCE->TEXTCONTENT.'</BR>'; ECHO 'LEAVES AND INDEMNITY:'.$LEAVESANDINDEMNITY->TEXTCONTENT.'</BR>'; ECHO 'GAMBLING TAX:'.$GAMBLINGTAX->TEXTCONTENT.'</BR>'; ECHO 'TAX ON INCOME:'.$TAXONINCOME->TEXTCONTENT.'</BR>'; ECHO 'CONSTRUCTION CORPORATION:'.$CONSTRUCTIONCORPORATION->TEXTCONTENT.'</BR>'; ECHO 'TAX ON CRUDE OIL:'.$TAXONCRUDE->TEXTCONTENT.'</BR>'; ECHO 'MINING ROYALTIES:'.$MININGROYALTIES->TEXTCONTENT.'</BR>'; ECHO 'OIL ROYALTIES:'.$OILROYALTIES->TEXTCONTENT.'</BR>'; // $NAME = MYSQL_REAL_ESCAPE_STRING(TRIM($NAME->TEXTCONTENT)); $ADDRESS = MYSQL_REAL_ESCAPE_STRING(TRIM($ADDRESS->TEXTCONTENT)); $COUNTY = MYSQL_REAL_ESCAPE_STRING(TRIM($COUNTY->TEXTCONTENT)); $COMMERCIALNO = MYSQL_REAL_ESCAPE_STRING(TRIM($COMMERCIALNO->TEXTCONTENT)); $ACTAUTHORIZATION = MYSQL_REAL_ESCAPE_STRING(TRIM($ACTAUTHORIZATION->TEXTCONTENT)); $POSTALCODE = MYSQL_REAL_ESCAPE_STRING(TRIM($POSTALCODE->TEXTCONTENT)); $PHONE = MYSQL_REAL_ESCAPE_STRING(TRIM($PHONE->TEXTCONTENT)); $FAX = MYSQL_REAL_ESCAPE_STRING(TRIM($FAX->TEXTCONTENT)); $YEARREGISTERED = MYSQL_REAL_ESCAPE_STRING(TRIM($YEARREGISTERED->TEXTCONTENT)); $OBSERVATIONS = MYSQL_REAL_ESCAPE_STRING(TRIM($OBSERVATIONS->TEXTCONTENT)); $DATEOFLASTSTATEMENT = MYSQL_REAL_ESCAPE_STRING(TRIM($DATEOFLASTSTATEMENT->TEXTCONTENT)); $LASTPROCESSING = MYSQL_REAL_ESCAPE_STRING(TRIM($LASTPROCESSING->TEXTCONTENT)); $CORPORATIONTAX = MYSQL_REAL_ESCAPE_STRING(TRIM($CORPORATIONTAX->TEXTCONTENT)); $ENTERPRISEINCOMETAX = MYSQL_REAL_ESCAPE_STRING(TRIM($ENTERPRISEINCOMETAX->TEXTCONTENT)); $EXCISE = MYSQL_REAL_ESCAPE_STRING(TRIM($EXCISE->TEXTCONTENT)); $VAT = MYSQL_REAL_ESCAPE_STRING(TRIM($VAT->TEXTCONTENT)); $SOCIALINSURANCECONT = MYSQL_REAL_ESCAPE_STRING(TRIM($SOCIALINSURANCECONT->TEXTCONTENT)); $INSURANCECONTRI = MYSQL_REAL_ESCAPE_STRING(TRIM($INSURANCECONTRI->TEXTCONTENT)); $UNEMPLOYMENTINSURANCE = MYSQL_REAL_ESCAPE_STRING(TRIM($UNEMPLOYMENTINSURANCE->TEXTCONTENT)); $HEALTHINSURANCE = MYSQL_REAL_ESCAPE_STRING(TRIM($HEALTHINSURANCE->TEXTCONTENT)); $LEAVESANDINDEMNITY = MYSQL_REAL_ESCAPE_STRING(TRIM($LEAVESANDINDEMNITY->TEXTCONTENT)); $gamblingtax = mysql_real_escape_string(trim($gamblingtax->textContent)); $taxonincome = mysql_real_escape_string(trim($taxonincome->textContent)); $constructioncorporation = mysql_real_escape_string(trim($constructioncorporation->textContent)); $taxoncrude = mysql_real_escape_string(trim($taxoncrude->textContent)); $miningroyalties = mysql_real_escape_string(trim($miningroyalties->textContent)); $oilroyalties = mysql_real_escape_string(trim($oilroyalties->textContent)); $gauranteefund = mysql_real_escape_string(trim($gauranteefund->textContent)); ?> <?php mysql_query("INSERT INTO basicinfoimport SET name='$name', address='$address', county='$county',commercialno='$commercialno', actauthorization='$actauthorization', postalcode='$postalcode', phone='$phone', fax='$fax', yearregistered='$yearregistered', observations='$observations', dateoflaststatement='$dateoflaststatement', lastprocessing='$lastprocessing', corporationtax='$corporationtax', enterpriseincometax='$enterpriseincometax', excise='$excise', vat='$vat', socialinsurancecont='$socialinsurancecont', insurancecontri='$insurancecontri',unemploymentinsurance='$unemploymentinsurance', guaranteefund='$gauranteefund', healthinsurance='$healthinsurance', leavesandindemnity='$leavesandindemnity', gamblingtax='$gamblingtax', taxonincome='$taxonincome', constructioncorporation='$constructioncorporation', taxoncrude='$taxoncrude', miningroyalties='$miningroyalties', oilroyalties='$oilroyalties', url='$url'") or die(mysql_error()); mysql_close() ?> <?php ?>
based on vgZ32
Output for 7.0.0 - 7.2.0
Notice: Undefined index: id in /in/NstQo on line 2 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/NstQo:12 Stack trace: #0 {main} thrown in /in/NstQo on line 12
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Notice: Undefined index: id in /in/NstQo on line 2 Fatal error: Call to undefined function curl_init() in /in/NstQo on line 12
Process exited with code 255.