Chat script
Hej når jeg kører mit chatscript på min IIS server giver den mig denne fejl:Notice: Undefined offset: 1 in C:\WebSite\chat\chat.php on line 7
Notice: Undefined offset: 2 in C:\WebSite\chat\chat.php on line 7
Notice: Undefined offset: 3 in C:\WebSite\chat\chat.php on line 7
Notice: Undefined offset: 4 in C:\WebSite\chat\chat.php on line 7
Notice: Undefined offset: 5 in C:\WebSite\chat\chat.php on line 7
Notice: Undefined offset: 6 in C:\WebSite\chat\chat.php on line 7
Notice: Undefined offset: 7 in C:\WebSite\chat\chat.php on line 7
Notice: Undefined offset: 8 in C:\WebSite\chat\chat.php on line 7
Notice: Undefined offset: 9 in C:\WebSite\chat\chat.php on line 7
Warning: Cannot add header information - headers already sent by (output started at C:\WebSite\chat\chat.php:7) in C:\WebSite\chat\chat.php on line 27
Her er koden til chat.php:
<?php
$besked_array = file("chat.htm");
$counter=1;
$gamle_beskeder="";
for ($counter=1; $counter<10; $counter++){
$gamle_beskeder .= $besked_array[$counter];
}
$ny_besked = "<b>$brugernavn:</b> <i>$besked</i><br>\n";
$open_file = fopen("chat.htm", "w");
$top = "<html>".
"<head>".
"<meta http-equiv=\"refresh\" content=\"2\">".
"</head>".
"<body>\n";
fputs($open_file, $top);
fputs($open_file, stripslashes($ny_besked));
fputs($open_file, $gamle_beskeder);
fclose($open_file);
header ("Location: skriv.php?brugernavn=$brugernavn");
?>
Jeg tror at det har noget at gøre med min server fordi når jeg uploader scriptet til min host virker den fint!! Kører PHP 4.2.1 (installer) på IIS 5.1 (WinXP)....