Computing.Net > Forums > Web Development > server sided html parsing?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

server sided html parsing?

Reply to Message Icon

Name: timothy_aah
Date: March 18, 2009 at 07:38:10 Pacific
OS: Windows XP
Subcategory: General
Comment:

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 side

the 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



Sponsored Link
Ads by Google

Response Number 1
Name: Radix-64
Date: March 31, 2009 at 09:33:13 Pacific
Reply:

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 -->


0
Reply to Message Icon

Related Posts

See More


free web host help Reducing size of webpage



Post Locked

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


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: server sided html parsing?

Server Side www.computing.net/answers/webdevel/server-side/262.html

accessing any HTML text client side www.computing.net/answers/webdevel/accessing-any-html-text-client-side/1866.html

Script, html, telnet coding help re www.computing.net/answers/webdevel/script-html-telnet-coding-help-re/1862.html