Location: PHPKode > projects > phpautotest > show_html_output.php
<?php
require 'includes/phpautotest_config.php';
require 'includes/phpautotest_functions.php';

require 'includes/header.php';

// IE refuses to send the cookie header to this page when it pops up. Authentication is disabled for this page.
//restrict_access();

if(isset($_GET['id']))
{
	$id = $_GET['id'];
}
else
{
	die('$_GET[\'id\'] is not set.');
}

// Use id to select the page
$QUERY = <<<END

	SELECT
		*
	FROM
		`$phpautotest_table_page`
	WHERE
		`id` = $id
END;

$result = phpautotest_send_query($QUERY);
$page = mysql_fetch_assoc($result);

$html_output = escape_for_regex($page['html_output']);

echo
"
<SCRIPT LANGUAGE='JavaScript'>
function paste_html_output()
{
	opener.document.edit_test.html_test.value = document.forms[0].html_output.value;
}
</SCRIPT>	

<form name = 'html_test'>
<textarea name = 'html_output' class = 'phpautotest_text' cols='70' rows='10' style='display: none'>$html_output</textarea>
<br>
<input type = 'button' value = 'paste html output' onClick = 'paste_html_output()' class = 'phpautotest_button'>
</form>
";
?>
Return current item: phpautotest