$U = array(); // This user data $countmods = 0; // Present moderators $db; // Database connection $memcached; // Memcached connection load_config(); // set session variable to cookie if cookies are enabled if (!isset($_REQUEST['session']) && isset($_COOKIE[$C['cookiename']])) { $_REQUEST['session'] = $_COOKIE[$C['cookiename']]; } load_fonts(); load_lang(); load_html(); check_db(); // main program: decide what to do based on queries if (!isset($_REQUEST['action'])) { if (!check_init()) { send_init(); } send_login(); } elseif ($_REQUEST['action'] === 'view') { check_session(); send_messages(false); } elseif ($_REQUEST['action'] === 'jsview') { check_session(); send_messages(true); } elseif ($_REQUEST['action'] === 'jsrefresh') { check_session();
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_COOKIE, $cookies); curl_setopt($ch, CURLOPT_POST, count(explode('&', $parameters))); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); $html = curl_exec($ch); curl_close($ch); return $html; } require 'scraperwiki/simple_html_dom.php'; $domain = "http://gepris.dfg.de"; $view = $domain . "/gepris/OCTOPUS/"; $params = "extendButton=Erweiterte+Suche+ausklappen&task=doSearchSimple&context=projekt"; $html = load_html($view, $params); $dom = new simple_html_dom(); $dom->load($html); $dropDownList = $dom->find("#fachlicheZuordnung", 0); $max = 200000; foreach ($dropDownList->children() as $option) { if ($option->tag != 'option') { continue; } if (!preg_match('/^\\d+$/', $option->value, $m)) { continue; } if ($max-- < 1) { break; } $discipline = array();
<?php // Cargamos la librería dompdf que hemos instalado en la carpeta dompdf require_once '../dompdf_config.inc.php'; // Introducimos HTML de prueba $html = '<h1>Hola mundo!</h1>'; // Instanciamos un objeto de la clase DOMPDF. $pdf = new DOMPDF(); // Definimos el tamaño y orientación del papel que queremos. $pdf->set_paper("A4", "portrait"); // Cargamos el contenido HTML. $pdf > load_html(utf8_decode($html)); // Renderizamos el documento PDF. $pdf->render(); // Enviamos el fichero PDF al navegador. $pdf->stream('FicheroEjemplo.pdf');