Print version of form results of MySQL database
Posted by: kevylyap
Posted on: 2008-11-29 09:29:00
I have created a form which "GETS" information from a MySQL database when the user submits the form.
<form name="example" method="get" action="result.php">
<input name="submit" type="submit" class="button" value="Submit Form" >
</form>
The results are displayed on a "result.php" page, in which I have provided a link to another page which is simpler in design so that it can be printed ("printable.php")
Example of the code at the "result.php" link is:
<a href="printable.php" target="_blank">Print this page</a>
However, when I click on the link, the print page shows many errors and the database results are not seen on the "printable.php" page.
Eg. of error:
"Warning: Invalid argument supplied for foreach() in /home/....../script.php on line 18"
What is wrong? Has it anything to do with my links? When I link the <form action="printable.php"> , I don't get the errors and the results can be seen.
How can I make the "result.php" into a printable version? My result.php consists of many tables, but I want the printable version to be just words
Would appreciate help from anyone...