JREAM Posted September 13, 2008 Share Posted September 13, 2008 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]; } ? Quote Link to comment https://forums.phpfreaks.com/topic/124033-undefined-index-whats-that-mean/ Share on other sites More sharing options...
GingerRobot Posted September 13, 2008 Share Posted September 13, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/124033-undefined-index-whats-that-mean/#findComment-640345 Share on other sites More sharing options...
CroNiX Posted September 13, 2008 Share Posted September 13, 2008 $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. Quote Link to comment https://forums.phpfreaks.com/topic/124033-undefined-index-whats-that-mean/#findComment-640650 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.