veeraa2003 Posted February 8, 2007 Share Posted February 8, 2007 Hello everybody, I'm new dude using PHP5 in linux. Here my problem is while I'm using ($_REQUEST["action"] method I got the following error/warning message... Notice: Undefined index: action in /var/www/html/intra/initial.php on line 5 My code on line 5 is: if ($_REQUEST["action"] == "delete" and trim($_REQUEST['id']) <> "") { $result = @mysql_query("DELETE FROM ".$tablename." WHERE id = '".trim($_REQUEST['id'])."'"); } I'm using PHP5 in linux environment. And is it the problem with register_globals = Off register_long_arrays = Off . But I changed this to vars to On in my php.ini. Is there any other variables to change. And the next thing whether the above message is a error message or warning message, If it is warnings how to disable this warings using my php.ini file. Let me know the particular variable to disable for not getting only warnings. Thanks in advance. Veeraa. Is there any mistake pls forgive me. Quote Link to comment https://forums.phpfreaks.com/topic/37583-help-with-undefined-index-action-in-varwwwhtmlintrainitialphp/ Share on other sites More sharing options...
trq Posted February 8, 2007 Share Posted February 8, 2007 The problem is not in your setup but your code. Yoiu try and use $_REQUEST["action"] without first checking to see if it exists. if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "delete" && trim($_REQUEST['id']) <> "") { As the message says. It is a notice, not an error or a warning. Read the comments in your php.ini with regard to error handling. Quote Link to comment https://forums.phpfreaks.com/topic/37583-help-with-undefined-index-action-in-varwwwhtmlintrainitialphp/#findComment-179808 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.