brown2005 Posted November 7, 2007 Share Posted November 7, 2007 elseif($saction == "submit") { $name = $_POST['name'] ? $_POST['name'] : ""; $email = $_POST['email'] ? $_POST['email'] : ""; $subject = $_POST['subject'] ? $_POST['subject'] : ""; $message = $_POST['message'] ? $_POST['message'] : ""; $priority = $_POST['priority'] ? $_POST['priority'] : ""; echo" name - $name <br> email - $email <br> subject - $subject <br> message - $message <br> priority - $priority"; header("location: $config_website_url/$config_website_url_topic/files/help.php?&view=helpdesk&action=email_us&saction=complete"); } i have that code at the moment, but it says headers have already been sent. is there any way around this, or should i put the process code in a separate php file... thanks... Link to comment https://forums.phpfreaks.com/topic/76361-header-redirection/ Share on other sites More sharing options...
rajivgonsalves Posted November 7, 2007 Share Posted November 7, 2007 this is because you outputted something to the browser before using header. remove the echo statements Link to comment https://forums.phpfreaks.com/topic/76361-header-redirection/#findComment-386605 Share on other sites More sharing options...
NArc0t1c Posted November 7, 2007 Share Posted November 7, 2007 You can use the ob_start function in the top of your script to fix header errors. Link to comment https://forums.phpfreaks.com/topic/76361-header-redirection/#findComment-386609 Share on other sites More sharing options...
aschk Posted November 7, 2007 Share Posted November 7, 2007 Don't use ob_start unless you ABSOLUTELY have to. My question is why are you trying to output something to a page which won't even get shown if you're redirecting.... Those echo's should never occur, no-one will ever see them. Link to comment https://forums.phpfreaks.com/topic/76361-header-redirection/#findComment-386623 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.