Jump to content

PHP warning / error message.  

  1. 1. PHP warning / error message.

    • PHP
      0
    • PHP warings
      0


Recommended Posts

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.

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.