popodc Posted November 2, 2006 Share Posted November 2, 2006 [color=red]any help/codes on how to print a specific whole php page with a css style.. textfields.. etc.. i just want the entire php page (even with images) to be printed when a "PRINT" button is pressed.. Cheers,[/color] Link to comment https://forums.phpfreaks.com/topic/25882-making-a-page-in-printable-version/ Share on other sites More sharing options...
fert Posted November 2, 2006 Share Posted November 2, 2006 Page1.htm[code]<form method="post" action="page1.php"><input type="submit" value="Print"></form>[/code]page1.php[code]$html="<html><head><title>Page</title><style></style><body bgcolor=\"color\">...";echo $html;[/code] Link to comment https://forums.phpfreaks.com/topic/25882-making-a-page-in-printable-version/#findComment-118230 Share on other sites More sharing options...
popodc Posted November 2, 2006 Author Share Posted November 2, 2006 [color=red]i have a page called "page1.php?empid=1234" theres a print button there that it would print all of the contents of that pages including, css, images, etc.. i dont have .html pages.. any more ideas? Thanks,[/color] Link to comment https://forums.phpfreaks.com/topic/25882-making-a-page-in-printable-version/#findComment-118232 Share on other sites More sharing options...
kenrbnsn Posted November 2, 2006 Share Posted November 2, 2006 Using a "Print" button is something that is done with Javascript, not PHP.What you do want to do is use a seperate CSS file that gets invoked when the page is printed, that way you can make sure that items that are not useful when printed, like navigatioin menus, are not printed.Please post any questions about using a print button with Javascript in the Javascript section. Any questions about CSS should be posted in the CSS section.Ken Link to comment https://forums.phpfreaks.com/topic/25882-making-a-page-in-printable-version/#findComment-118235 Share on other sites More sharing options...
fert Posted November 2, 2006 Share Posted November 2, 2006 [code]$html="html code";if($_GET[empid]!=){ if($_GET[empid]=="1234") { echo $html; }}else{ echo "<form action=\"page1.php\" method=\"get\">"; echo "<input type=\"hidden\" name=\"empid\" value=\"1234\">"; echo "<input type=\"submit\" value=\"Print\"></form>";}[/code] Link to comment https://forums.phpfreaks.com/topic/25882-making-a-page-in-printable-version/#findComment-118236 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.