Okay, I got it to work, but with a bit of a cluge:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>My Title</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
</HEAD>
<BODY>
<?php
$configFile=file_get_contents('../../../wiki/data/pages/numberofpages.txt');
$somenumber=rand(1, ($configFile*1));
$filename='http://www.mydomain.com/wiki/doku.php?id=myarticle'.$somenumber.'&do=export_xhtmlbody';
echo file_get_contents($filename);
?>
<br />
</p>
</BODY></HTML>
So, instead of reading in one big file and parsing it, then outputting a random article, I did it in two steps:
1) Read in a Wiki article that only contains a number representing the number of available articles
2) Use that number as the upper boundary to get a random number, and display the corresponding article.
Probably a lot quicker than using one big file. The fopen command always gave me a blank page, even if I tried to just display the whole thing without parsing it.
Thanks everyone!