Re: [users@httpd] How to build layers/filters with Apache and PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- Nick Kew <nick@xxxxxxxxxxxx> wrote:

> On Wednesday 26 April 2006 11:06, Gioele Barabucci
> wrote:
> > Hello,
> >
> > I have and unmodifiable PHP application that runs
> on an apache installation. 
> 
> > I would like to create a chain like this:
> > | request -> get.php -> validator.php -> output
> 
> I don't believe you can do that (though there are
> snake-oil
> scripts floating around that claim to validate). 
> You can come
> pretty close to validating by passing the output
> through a
> DTD-based filter: for example
> http://apache.webthing.com/mod_publisher/dtd.html
> 
> > With J2EE this was simple because you could stack
> one filter upon another
> > without too much hassle. Is there something
> similar for Apache/PHP?
> 
> See above.  Apache, yes.
> 
> -- 
> Nick Kew

What I didn't catch is why the original php scripts
couldn't be edited.
if the output section of the scripts was edited to
have valid XHTML as output it would be much simpler.

an example of a simple function to dump validating
xhtml header data to apache:

function printHeader(){
	echo <<<EOF
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; lang="en">
<head>
<meta http-equiv="Content-Type"
content="application/xhtml+xml; charset=UTF-8"/>
<title>$title</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="Author" content=""/>
<meta http-equiv="Content-Style-Type"
content="text/css" />
<link rel="stylesheet" media="all" type="text/css"
href="css/fixed.css"/>
</head>
<body>

EOF;
}

the <?xml version="1.0" ?> actually makes it easier to
obtain correct functionality in IE with validating
pages, It throws IE into "Quirks" mode making it work
better with xml and css.

Jaqui

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux