Hello.
Im currently trying to make a preview page for my admin area.
My idea was to create a page called preview.php. Apon entering some text into a textfield entitled 'Homepage' on my main admin page, one could then click the preview button which would take them to preview.php.
However I havent gotten that far yet as I cant seem to use Javascript within my PHP.
<?php
$open = echo '<script language="JavaScript"> document.getElementsByName("Homepage").value </script>'
?>
<?php function preview()
{ $preview = $open;
$file = fopen('preview.txt', "a");
fwrite ($file, $preview );
fclose($file); }
?>
The first bit of code was an attempt to capture the contents of the admin area field called Homepage, the second bit of code I had hoped would store it in a text document called Preview.txt
I keep getting error messages relating to T ECHO - so I assume its something relating to my first bit of code. Any pointers?
Thanks for any help!