shamsuljewel Posted July 6, 2007 Share Posted July 6, 2007 A form pass two variable a textarea and a radio if anyone is empty the browser was redirect to the form again. I am using if(($_post[text1]=="") || ($_post[func]=="")) { header("Location: generic_form.htm"); exit; } but I found an error that is "Warning: Cannot modify header information - headers already sent by (output started at c:\Inetpub\wwwroot\pra...." Where is the problem? can anyone help me? thanks Link to comment https://forums.phpfreaks.com/topic/58685-header-problem/ Share on other sites More sharing options...
NArc0t1c Posted July 6, 2007 Share Posted July 6, 2007 Any cookies set on the page before the if statement? and use post with the caps, easier to read.. if($_POST['text1'] == '' || $_POST['func'] == '') { header("Location: generic_form.htm"); exit; } Link to comment https://forums.phpfreaks.com/topic/58685-header-problem/#findComment-291092 Share on other sites More sharing options...
shamsuljewel Posted July 6, 2007 Author Share Posted July 6, 2007 Yes I solve it. php block should write at the top of the code. Thanks Link to comment https://forums.phpfreaks.com/topic/58685-header-problem/#findComment-291122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.