Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
the topic title speaks for itself I guess...
is there any way to parse html on the server, i.e. without sending it to the client sidethe idea would be to parse html pages, and then sending those to a printer (I need the html layout)
right now I have this:
-----------------------------------
<?php
$filename = "print.php";ob_start();
include $filename;
$contents = ob_get_contents();
ob_end_clean();$handle = printer_open("<printer_address>");
printer_write($handle,$contents);
printer_close($handle);
?>
-----------------------------------obviously this just gives me the raw html code, outputted by the print.php file
so how do I parse that html, and THEN send it to the printer?
thx in advance

Hi, for the HTML parsing, have you configured your ".htaccess" to allow HTML parsing (AddHandler, Addtype)? I believe that the handler directives instruct the server to parse the file types that you specify. Once enabled, you should be able to add SSI commands to those file types. To check your handler directives, go to your server's config file (typically called httpd.conf).
Regarding the print portion, are you using an Apache HTTP Server? If so and if you have version 1.2 or above, have you tried using the "printnav" function? "Printenv" outputs a listing of all existing variables with the associated values.
<!--#printenv -->

![]() |
free web host help
|
Reducing size of webpage
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |