after reading several threads regarding redirects and code causing the "Cannot modify header information" error, i still don't get it.
i mean, before i even did some research, the very nature of the error, and the code (at least in my script) seems to describe what's going on-- that the same header info can't be sent more than once, or is it that it can not be received more than once...
regardless, i don't understand why this book would have laid out the code this way, if it inevitably was going to cause an error. the script is set up to check for $_POST[ab] != [cd] .
since at the point in which that comparison operator is used, the html form embeded in the PHP has not yet been submitted, so $_POST[ab] will have a NULL value every time the page is loaded. this is part of an IF statement in which, when the result of that comparison is returned TRUE, it jumps to the end of the script to an html block in which a variable holding the entire html form is displayed by a single line of PHP w/in that HTML block such that the form is then ECHOed , ready to submit the text fields for reprocessing in this same page.
once the form is submitted, now $POST[ab] == [cd] because of the hidden form value. so, the $POST[ab] != [cd] now returns FALSE and the ELSE IF statements are checked as shown in my first post.
so, i see what's going on... that it is using the same page to display different results depending upon the values of the text field and radio buttons. it doesn't make sense that the book i'm using would contain erroneous code-- at least it doesn't indicate "notice the error produced by line...", know what i mean? no solution is offered, and no error is discussed.
i've searhced php.net for header(), but i didn't find a solution there either. from what i've read here and at php.net's manual, it seems to me that i would practically have to rewrite a lot of the code, or use a separate page.
i'm not discounting the fact that i could be missing something, or that i may have mistyped some code as i copied it from the book, but it still doesn't make sense to me that the code would work otherwise. the header("Location: filename.php"); is used more than once in the script, so it's obviously suppsed to be there as entered. i'm stumped.
when you suggested i do a search, what did you have in mind i use as keywords?