You have been extremely helpful. I'm not so sure we are on the same page. I need to call this script whenever the user clicks a link on the page:
<A href="javascript:WritePage()">1-5</A>
But that does not work and I think I'll give up on php code inside javascript.
I made new code without direct javascript but I don't know how to call it from a link:
<?
function WritePage()
{
$data = file('http://foryouandi.com/begin.php');
echo "<script type='text/javascript'>";
echo "document.open();";
foreach($data as $line)
{
echo "document.write('" . addslashes(trim($line)) . "');\n";
}
echo "document.close();";
echo '</script>';
}
?>
//Try to call:
<A href="php:WritePage()">1-5</A> //no
<A href="WritePage()">1-5</A> //no