Hi all
I've just installed php 4.0.6 on my system and was happily coding away when the following error pops up : Warning undefined variable !!!!
Now as far as i'm aware you don't need to define variables in php - so how come this error.
here's the code you all you code monkeys to take a look at
Its nothing special - anyone know why i'm getting an undefined variable error ?
<?
$database = "scam";
$username = "root";
$password = "b0ff1n";
$conn = mysql_connect("localhost", $username, $password);
mysql_select_db($database, $conn);
switch($action)
{
case "add_group":
$SQL = "INSERT INTO groups (name) VALUES ('$group_name')";
print $SQL;
break;
}
print "<form action=$PHP_SELF method=\"post\">\n";
print "<input type=\"text\" name=\"group_name\">\n";
print "<input type=\"submit\" value=\"Add group\">\n";
print "<input type=\"hidden\" name=\"action\" value=\"add_group\">\n";
print "</form>\n";
?>