FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


docType





rjraaz
i have come up with a class which can generate xhtml depending upon browser support

http://www.phpclasses.org/browse/package/5879.html
jmraker
It might just be me but I don't think I'd ever use this, I use a html page to DOM in a "scanning" program that parses several saved page's <form> and <script> tags to see if the site changed them. I had to keep bumping up the memory limit until it got insane. I had to gut the program to the basics (remove functions, variables etc) in order for it to use less than 64 megs of memory on large files. I suspect this may use too much memory also, probably not as much but enough to go over 8 meg.

The docType program example:
Code:
<?php
require_once('xml_doctype.inc');
$dom = new DOMDocument('1.0','UTF-8');
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;

$myPage = new docType($dom);
$xmlHtml = $myPage->document();

$xmlHead = $dom->createElement('head');
$xmlTitle = $dom->createElement('title','I Am a Web Page');
$xmlHead->appendChild($xmlTitle);
$xmlHtml->appendChild($xmlHead);

$xmlfile = 'content.xml';
$buffer = file_get_contents($xmlfile);
$tmpDOM = new DOMDocument('1.0','utf-8');
$tmpDOM->loadXML($buffer);
$nodeList = $tmpDOM->getElementsByTagName('body');
$impBody = $nodeList->item(0);
$xmlBody = $dom->importNode($impBody,true);
$xmlHtml->appendChild($xmlBody);

$myPage->sendheader();
$myPage->sendpage();
?>
Fire Boar
A lot of memory errors can be fixed by changing by-value parameters to by-reference. If you're generating a huge array, for example, passing by-value creates a copy of this array to pass to the new function, effectively doubling the amount of space it's taking up. If you pass this around a lot of functions, you're using up more and more space constantly. Passing by reference, on the other hand, only copies a pointer, which is 4 bytes long on a 32-bit system. Which is nothing, really.
rvec
eehm I don't get it, why would you use php for that? Can't all mayor browsers (even IE6) just read xhtml and interpret it as html when they don't understand stuff?
Related topics
script backup database
The worlds shortest and laziest Mambo tutorial.
Site Nav Suggestions...
Why You Should Never Use Flash
CSS layout help
Search function
Le référencement
HTML Help
CSS
Black and a bright colour goes well
SDRAM vs DDRAM
Firefox does not like my webpage...
Different Doctype, how can I make them both work
Question about label <!DOCTYPE>
HTML5 is this the correct heading <!doctype html>
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.