global $xslt_file; global $xslt_data; global $generated_form_html; // create a new form object with the // form id from the SESSION variable if (isset($_SESSION['submission_id'])) { $form = new Form($_SESSION['form_id'], $_SESSION['submission_id']); unset($_SESSION['submission_id']); } else { $form = new Form($_SESSION['form_id']); } // store the form in a session variable // it will be used once the page has been // posted back $_SESSION['obj_form'] = $form; $xml_data = $form->generate_xml(); $generated_form_html = ""; // check what version of php we are running. // this is needed since php5 does not have the // xslt_create function - no sablotron. if (phpversion() < 5.0) { // for debugging only - write out xml to file //$file = fopen("/tmp/xml.txt", "w"); //fwrite($file, $xml_data); //fclose($file); // read xslt stylesheet into local variable $file = fopen($xslt_file, "r"); $xslt_data = fread($file, filesize($xslt_file)); fclose($file); // create new xlst processor $xslt_processor = xslt_create();