I am getting the following errors to a random quote script I have:
[CODE]PHP Notice: Undefined offset: 3 in /home1/shamaror/includesem/lgrquote.php on line 58
PHP Notice: Undefined offset: 2 in /home1/shamaror/includesem/lgrquote.php on line 58
PHP Notice: Undefined offset: 1 in /home1/shamaror/includesem/lgrquote.php on line 58
PHP Notice: Undefined offset: 3 in /home1/shamaror/includesem/lgrquote.php on line 58
PHP Notice: Undefined offset: 2 in /home1/shamaror/includesem/lgrquote.php on line 58
PHP Notice: Undefined offset: 1 in /home1/shamaror/includesem/lgrquote.php on line 58
I don’t know too much about PHP, especially this type of problem. Any suggestions?
[CODE]$quotetitle=””;
$quotefile=”quotes.txt”;
$dir=$_SERVER[‘DOCUMENT_ROOT’];
//No need to change anything below here.
if (file_exists($dir.”/”.$quotefile)) {
$quote=file($dir.”/”.$quotefile);
$rand_key=array_rand($quote, 1);
list($qtext, $qauthor, $qlink, $qlinktext) = explode(“|”, trim($quote[$rand_key]));
if (isset($qtext) && $qtext!=””) { echo $qtext; }
}
?>