Notice: Undefined offset: 9 in *hidden*\random.php on line 9
this is the line it is referring to:
$RandomRotator1 = ereg_replace("\n","",$file[$randcount]);
This is the whole of random.php
Code: Select all
<?php
$RandomRotator1 = "";
$filename = "random.txt";
$file = file($filename);
srand((double)microtime()*1000000);
while ($RandomRotator1 == "") {
if(!isset($sp)){
$randcount = rand(0,count($file));
$RandomRotator1 = ereg_replace("\n","",$file[$randcount]);
}else{
$RandomRotator1 = ereg_replace("\n","",$file[$sp]);
}
}
print "$RandomRotator1";
?>As you can probably see it is supposed to take a random line from a file called random.txt and display it. It does work (it displays a random advertisement) but i get the error on top of it...
Can anybody help please ?