Loading an HTML page
Posted: Thu Mar 15, 2007 3:37 pm
Hello,
I can't seem to load an html page.
I know this is probably the most basic question but I can't seem to
find a tutorial or instructions besides the php.net's loadHTMLFile
which seems to throw up a bunch of errors.
I test at home using php5 so I can't test until later but here is
what I've already tried, it's in an if statment
php5 code snippet
This throws up errors and then the HMTL page requested underneth the errors.
I can't remember what exactly the errors are because I'm at work but I'm curious if I'm even on the right track?
Should I be using fopen which didn't seem to work either.
If you have some quidance or know of a script online I can look at that would be cool.
thanks, sorry it's kinda vague I'm at work trying to figure this out on my down time.
sky
I can't seem to load an html page.
I know this is probably the most basic question but I can't seem to
find a tutorial or instructions besides the php.net's loadHTMLFile
which seems to throw up a bunch of errors.
I test at home using php5 so I can't test until later but here is
what I've already tried, it's in an if statment
php5 code snippet
Code: Select all
if(!empty($myVariable)){
$doc = new DOMDocument();
$doc->loadHTMLFile("filename.html");
echo $doc->saveHTML();
}else{
$doc = new DOMDocument();
$doc->loadHTMLFile("filename.html");
echo $doc->saveHTML();
}I can't remember what exactly the errors are because I'm at work but I'm curious if I'm even on the right track?
Should I be using fopen which didn't seem to work either.
If you have some quidance or know of a script online I can look at that would be cool.
thanks, sorry it's kinda vague I'm at work trying to figure this out on my down time.
sky