Jump to content

Recommended Posts

Notice: Undefined index: login in C:\Active_Projects\X8\cms\core\admin.settings.php on line 152

 

$login = $_POST['login'];

 

Above is what is on the line, am I not suppose to set variables to this?

What is a way to fix this?

 

something like: function p($value) { $_POST[$value]; }  ?

Link to comment
https://forums.phpfreaks.com/topic/124033-undefined-index-whats-that-mean/
Share on other sites

It means that there isn't an element in the $_POST array called login. I would assume you are expecting that there should be, so check the spelling of your form's name - don't forget it is case sensitive. Other than that, we'd need to see some more code to help you further.

$login = isset($_POST['login') ? $_POST['login'] : "";

This code is how I set variables sent via url.  First it checks if 'login' exists in the POST array, if it does it uses that value, if it doesn't it sets it to an empty string.  Of course you should also ALWAYS sanitize variables that are sent through a URL as they can be manipulated by the sender and used for an injection attack.

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.