watagal Posted May 12, 2008 Share Posted May 12, 2008 Greetings--PHP Code: 15: $postRememberUserName = $_POST['chkRememberUserName'];16: $postRememberPassword = $_POST['chkRememberPassword']; Output: Notice: Undefined index: chkRememberPassword in D:\xampp\htdocs\_mysites\clark-kleinheinz.com\Html_php_code\processSignIn.php on line 16Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\_mysites\clark-kleinheinz.com\Html_php_code\processSignIn.php:16) in D:\xampp\htdocs\_mysites\clark-kleinheinz.com\Html_php_code\processSignIn.php on line 61 Both #15 & #16 are from <input type="checkbox"> elements in my Sign In form. The "'chkRememberUserName'" was checked and "'chkRememberPassword'" was unchecked. If Icheck both, I don't get these notices and warnings. Am I ok on this, no need to worry? Is a $_POST[] considered HTML code output, therefore the header() warning?TiA, Gal Link to comment Share on other sites More sharing options...
Wander Posted May 12, 2008 Share Posted May 12, 2008 no, the warning is the html output, not the $_POST datau can better use isset($_POST['something']) to see if something is checked, to prevent warnings being givenexample:$postRememberUserName = isset($_POST['chkRememberUserName'])?true:false;$postRememberPassword = isset($_POST['chkRememberPassword'])?true:false;after this, both variables will be true if checked and false if not checked Link to comment Share on other sites More sharing options...
watagal Posted May 12, 2008 Author Share Posted May 12, 2008 Thanks, I'll do as you suggest.So a checkbox, if unchecked will not return any POST data? not false, not "off", etc.Thanks again. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 12, 2008 Share Posted May 12, 2008 So a checkbox, if unchecked will not return any POST data? not false, not "off", etc.Correct Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.