pedrobcabral Posted February 11, 2007 Share Posted February 11, 2007 I want to evaluate a form in the same page where it is. I'm using sometinhg like <?php if ($_POST['variable']) someting; ?> The problem is I'm getting the followind error: PHP Notice: Undefined index: utilizador in /Applications/MAMP/htdocs/registo.php on line x Does anyonw knows why? Thank you. Link to comment https://forums.phpfreaks.com/topic/38034-solved-form/ Share on other sites More sharing options...
Jessica Posted February 11, 2007 Share Posted February 11, 2007 The the variable wasn't posted. Use if(isset($_POST['variable'])){ //something }else{ //something else. } Link to comment https://forums.phpfreaks.com/topic/38034-solved-form/#findComment-182080 Share on other sites More sharing options...
Yesideez Posted February 11, 2007 Share Posted February 11, 2007 "something" needs to be contained in swirly brackets: <?php if ($_POST['variable']) {someting;} ?> Link to comment https://forums.phpfreaks.com/topic/38034-solved-form/#findComment-182083 Share on other sites More sharing options...
Jessica Posted February 11, 2007 Share Posted February 11, 2007 Yesi: Not if it's only one line. That's not the issue here. It is good practice to always use braces though. Link to comment https://forums.phpfreaks.com/topic/38034-solved-form/#findComment-182085 Share on other sites More sharing options...
pedrobcabral Posted February 11, 2007 Author Share Posted February 11, 2007 one hour around this ARGHH. thank you. Link to comment https://forums.phpfreaks.com/topic/38034-solved-form/#findComment-182092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.