I just upgraded my PHP and ohh boy.. They turned off the global variable and now I get lots and lots of Undefined Variable. I don't want to turn it back on coz I'm aware of the security issue. So... Umm. How do I make my code compatible with the global variable turned off?
My code is messy isn't it?
I only had 1months experience in PHP and i'm still learning.. So pls bear with me.
###############################################
mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
if($_POST['submit']){
$insert = "INSERT INTO journal (date,time,content) VALUES ('$date','$time','$content')";
mysql_query($insert);
}
elseif($update){
$update = "UPDATE journal SET date='$date', time='$time', content='$content' WHERE id='$id'";
mysql_query($update);
}
elseif($action == "del"){
$delete = "DELETE FROM journal WHERE id='$id'";
mysql_query($delete);
}
Turn all the values you got from post forms into $_POST['fieldname'], all values from a query string into $_GET['somename'], session vars come from $_SESSION, cookies form $_COOKIE...