Undefined index:

I have created an update page where the data I want to change appears. However, when I click save, I get an error message: Notice : Undefined index: slug in C:\xampp\htdocs\dynamic\egypt\Admin\php_action\update.php on line 8, followed by →

Succcessfully Updated

When I check the file in my index.php file, only the one field is not altered.

This is the database table headings:

This is the edit (update) page before submission:

.

How can I resolve this issue.

Depends on what you see as a solution.

  1. use a default value for that array index like $foo['slug'] ?? 'bar'
  2. check why you are using an array index that does not exist, looking at the array with var_dump

I’m going to assume you copied and pasted the inputs since I don’t see any code that makes that form?

Did you give the input for the slug a name?

Thanks for the advice.

The image is a screen shot of the input data. However, seeing your advice, I checked the name of the field and found I misspelled it. Will resolve it soon.

Thank you for the help.

Sponsor our Newsletter | Privacy Policy | Terms of Service