undefined variable problem {solved}
Posted: Tue Jun 16, 2009 3:39 pm
hey guys this is my code and i get the message Notice: Undefined variable: result in C:\Web Files\wamp\www\***\***.php on line 60 which is the highlighted line. Any ideas? I thought the variable is defined.
Code: Select all
if(!$_POST['action']){
header ("Location: index.html");
}
else{
$link = connect(HOST, USER, PASSWORD);
switch($_POST['action']){
case "update":
$res = getContent($link, 20);
while($row = mysql_fetch_array($res)){
[color=#FF0000]$result .= "<li><strong>".$row['user']."</strong><img src=\"css/images/bullet.gif\" alt=\"-\" [/color]/>".$row['message']." <span class=\"date\">".$row['date']."</span></li>";
}
echo $result;
break;
case "insert":
echo insertMessage($_POST['nick'], $_POST['message']);
break;
}