Hello guys,
A while back my nephew helped me to make me a simple website using a little bit of php. But since my webhoster upgraded the server to php 7, it is showing a blank page below the header. There is only one page which uses a bit of php and that’s the index. The php is used for the menu just below the header. Luckily I can set my php back but my webhoster asked me to update the scripting. And I would normally do that, but my nephew died a year ago and I only know a bit about html. I already figured out it has something to do with “split” which is depreciated, but I couldn’t get it fixed. I am positive it is a minor change but please would somebody be so kind to help me find the culprit?
I think the problem occurs in this part of the script on my index:
[php]
<?php
$dirPrefix = "/?p=";
$openDir = "page";
$fileDir = opendir($openDir);
$sortFiles = array();
while($sortFiles[] = readdir($fileDir));
sort($sortFiles);
closedir($fileDir);
echo '<li><a href="/">Home Page</a></li>';
foreach ($sortFiles as $eachFile) {
if ($eachFile != "." && $eachFile != "..") {
list($fileName, $fileExtension) = split('[/.-]', $eachFile);
$ucFileName = ucfirst($fileName);
if($ucFileName == "Home" OR $ucFileName == "Contact" OR $ucFileName == "Examplepage" OR $ucFileName == "") { } else {
echo '<li><a href="' . $dirPrefix . $fileName . '">' . $ucFileName . '</a></li>';
}
}
}
echo '<li><a href="' . $dirPrefix . 'contact">Contact</a></li>';
?>
[/php]
Thanks in advance guys!