m00nz00mer Posted March 20, 2008 Share Posted March 20, 2008 hey, got abit of a problem, ive got this small login script and its working on my mates host however when i upload it, i get Notice: Undefined index: loginUserName on line 17 which is... <? $username = "admin"; $password ="password"; if ($_POST['loginUserName']!= $username || $_POST['loginPassword']!= $password) { ?> <h4>Login Below:</h4> <div class="detailTextGrey"> <!-- Login Form --> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> User Name: <input type="text" name="loginUserName" /> <br /> Password: <input type="password" name="loginPassword" /> <br /><br /> <input type="hidden" name="submitted" value="1" /> <input type="submit" value="Submit" /> </form> </div> <? } else { ?> anyone know why im getting this error? Link to comment https://forums.phpfreaks.com/topic/97165-notice-undefined-index/ Share on other sites More sharing options...
cooldude832 Posted March 20, 2008 Share Posted March 20, 2008 you are trying to work on variables that aren't defined thus an undefined index error. It happens in both servers just one reports the warning the other doesn't Link to comment https://forums.phpfreaks.com/topic/97165-notice-undefined-index/#findComment-497194 Share on other sites More sharing options...
clown[NOR] Posted March 20, 2008 Share Posted March 20, 2008 i helped him with the code... and here it works perfect both local and on my server... Link to comment https://forums.phpfreaks.com/topic/97165-notice-undefined-index/#findComment-497198 Share on other sites More sharing options...
m00nz00mer Posted March 20, 2008 Author Share Posted March 20, 2008 anyone? Link to comment https://forums.phpfreaks.com/topic/97165-notice-undefined-index/#findComment-497228 Share on other sites More sharing options...
cooldude832 Posted March 20, 2008 Share Posted March 20, 2008 I gave u the answer. Link to comment https://forums.phpfreaks.com/topic/97165-notice-undefined-index/#findComment-497231 Share on other sites More sharing options...
m00nz00mer Posted March 21, 2008 Author Share Posted March 21, 2008 how can i stop it from reporting the error? Link to comment https://forums.phpfreaks.com/topic/97165-notice-undefined-index/#findComment-497264 Share on other sites More sharing options...
m00nz00mer Posted March 21, 2008 Author Share Posted March 21, 2008 is there a work around for this? cheers. Link to comment https://forums.phpfreaks.com/topic/97165-notice-undefined-index/#findComment-497265 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.