contra10 Posted September 19, 2011 Share Posted September 19, 2011 i'm having trouble working with my search bar, when i used wamp it worked but now online i keep getting this message Cannot modify header information - headers already sent by (output started at...) I placed that code for the search bar above the html tags but i keep getting the error here is my coding <?php mysql_connect("localhost", "user", "pass") or die(mysql_error()); if (isset($_POST['submit'])) { $search = mysql_real_escape_string($_POST['search']); $type = mysql_real_escape_string($_POST['type']); if ($type == true) { header("Location:http://www.link.com/searchresults.php?subdirectory=$search&type=$type"); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/247405-cannot-modify-header-error/ Share on other sites More sharing options...
jcbones Posted September 19, 2011 Share Posted September 19, 2011 Do you see all of the whitespace before the <?php tag? Remove it. Quote Link to comment https://forums.phpfreaks.com/topic/247405-cannot-modify-header-error/#findComment-1270531 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.