StueyB
01-10-2008, 06:48 AM
Hi Everyone,
I'm hoping someone can help me here as I have a rather strange problem and I have spent days (no joking) trying to figure it out.
I have a script that generates sets of new pages every day. It basically takes a template, and reads in new links and hyperlinked images from a file and exports it to a new file that people can see (100bestsites.html). Embedded in this file is a php include to 3 files, top.php, trade.php and bottom.php. All these relate to banners.
An example content of top.php is similar to
<a href="http://www.myothersite.com" title="whatever"><img src="/images/banner1.gif" alt="new alt tag for whatever"></a>
Now the pages themselves are ok, and work for the most part but they wont parse the following (ie if you open firefox, all the following appears in pink)
<?php
$file = $includePath . "top.php";
$the_page = fopen($file, "r");
if($the_page!=0) {
while(!feof($the_page)) {
$each_line = fgets($the_page, 255);
echo $each_line;
}
}
?>
Also the other php code in there also appears in pink and hasn't been executed.
<?php
$stylePath = "http://www.mysite.com/templates/newstyle.css";
$includePath = "/home/pathtomysite/mysite.com/";
?>
This site is on dreamhost. It used to work on the previous semi dedi server before, honest! I have tried it on php5 and php4 but it still refuses to work
It's as if it refuses to parse any php in the new outputed html document to pick up these files. I don't get any error messages either.
Any ideas?
I'm hoping someone can help me here as I have a rather strange problem and I have spent days (no joking) trying to figure it out.
I have a script that generates sets of new pages every day. It basically takes a template, and reads in new links and hyperlinked images from a file and exports it to a new file that people can see (100bestsites.html). Embedded in this file is a php include to 3 files, top.php, trade.php and bottom.php. All these relate to banners.
An example content of top.php is similar to
<a href="http://www.myothersite.com" title="whatever"><img src="/images/banner1.gif" alt="new alt tag for whatever"></a>
Now the pages themselves are ok, and work for the most part but they wont parse the following (ie if you open firefox, all the following appears in pink)
<?php
$file = $includePath . "top.php";
$the_page = fopen($file, "r");
if($the_page!=0) {
while(!feof($the_page)) {
$each_line = fgets($the_page, 255);
echo $each_line;
}
}
?>
Also the other php code in there also appears in pink and hasn't been executed.
<?php
$stylePath = "http://www.mysite.com/templates/newstyle.css";
$includePath = "/home/pathtomysite/mysite.com/";
?>
This site is on dreamhost. It used to work on the previous semi dedi server before, honest! I have tried it on php5 and php4 but it still refuses to work
It's as if it refuses to parse any php in the new outputed html document to pick up these files. I don't get any error messages either.
Any ideas?
