jb-data.de/test_ilo.php
2025-08-11 22:23:30 +02:00

111 lines
No EOL
3.2 KiB
PHP

<?php
error_reporting(E_ALL); ini_set('display_errors',1);
$kw_aktuell = (int)date('W');
$jahr = (int)date('Y');
require('lib/config.php');
require('lib/mysql.class.php');
$GLOBALS['mysql'] = new mysql(CONFIG_MYSQL_HOST,CONFIG_MYSQL_USER,CONFIG_MYSQL_PW,CONFIG_MYSQL_DB);
mysqli_set_charset($mysql, 'utf8');
header("Content-Type: text/html; charset=utf-8");
//----------------------------------------------------------------------------------------------------------------
include('lib/sd/simple_html_dom.php');
$url = 'https://mob.ilonexs.de/php/prj_web/mob_meineimporte.php?ak=MbL~9X2kZU~';
//$url = 'https://ssl.ilonexs.de/php/prj_web/mob_meineimporte_print.php?ak=MbL~9X2kZU~';
//$url = 'https://ssl.ilonexs.de/php/prj_web/mob_rollkarte_de.php?fromold=JA&s=JBT&p=159753';
// geht
// echo file_get_html('https://mob.ilonexs.de/php/prj_web/mob_notrollkarte.php?ak=MbL~9X2kZU~&fe=1')->plaintext;
/*
$html=file_get_html('https://mob.ilonexs.de/php/prj_web/mob_notrollkarte.php?ak=MbL~9X2kZU~&fe=1');
$title = $html->find('#class="adresse"', 0)->plaintext;
echo $title;
echo "<pre>"; print_r($string); echo "</pre>";
echo "<pre>"; print_r($pos); echo "</pre>";
echo "<pre>"; print_r($post); echo "</pre>";
*/
//----------------------------------------------------------------------------------------------------------------
$_buffer = loaddata($url, "ANZSDG");
echo $_buffer;
//----------------------------------------------------------------------------------------------------------------
/*
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseBody = curl_exec($ch);
curl_close($ch);
$domDocument = new DOMDocument();
$domDocument->loadHTML($responseBody);
$phpMajorVersions = array();
$xPath = new DOMXPath($domDocument);
$result = curl_exec($curl_connection);
print $result;
foreach ($xPath->query('<td id=\"tbl_rollkarte\">') as $tableHeaderElement) {
$version = trim($tableHeaderElement->textContent);
if (strlen($version) === 3) {
$phpMajorVersions[] = $version;
}
}
echo "<pre>"; print_r($xPath); echo "</pre>";
echo "<pre>"; print_r($version); echo "</pre>";
echo "<pre>"; print_r($phpMajorVersions); echo "</pre>";
*/
//----------------------------------------------------------------------------------------------------------------
// [name] => 09u7503jgfgf1
//----------------------------------------------------------------------------------------------------------------
function loaddata($url, $postdata)
{
$agent = "Meine Browserkennung v1.0 :)";
$header[] = "Accept: text/vnd.wap.wml,*.*";
$ch = curl_init($url);
if ($ch)
{
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
# mit den nächsten 2 Zeilen könnte man auch Cookies
# verwenden und in einem DIR speichern
#curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
#curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
if (isset($postdata))
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
}
$tmp = curl_exec ($ch);
curl_close ($ch);
}
return $tmp;
}
?>