Header function php -


warning: cannot modify header information - headers sent (output started @ /srv/disk2/1201823/www/-----------.org/florida/bookingv1.php:1) in /srv/disk2/1201823/www/-----------.org/florida/bookingv1.php

this error i'm getting. how can fix it?

here's code.

<?php  if ((isset($_post["mm_insert"])) && ($_post["mm_insert"] == "form2")) {     $x = $_post['noofpass'] * 500;     $insertsql = sprintf("insert booking2 (lastname, firstname, email, address, contactno, bustype, `from`, `to`, noofpass, datemonth, `day`, `time`,amount) values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,$x)",              getsqlvaluestring($_post['lastname'], "text"),              getsqlvaluestring($_post['firstname'], "text"),              getsqlvaluestring($_post['email'], "text"),              getsqlvaluestring($_post['address'], "text"),              getsqlvaluestring($_post['contactno'], "int"),              getsqlvaluestring($_post['bustype'], "text"),              getsqlvaluestring($_post['from'], "text"),              getsqlvaluestring($_post['to'], "text"),              getsqlvaluestring($_post['noofpass'], "int"),              getsqlvaluestring($_post['datemonth'], "text"),              getsqlvaluestring($_post['day'], "int"),              getsqlvaluestring($_post['time'], "text"));      mysql_select_db($database_connection, $connection);     $result1 = mysql_query($insertsql, $connection) or die(mysql_error());      $insertgoto = "confirmation.php";     if (isset($_server['query_string'])) {         $insertgoto .= (strpos($insertgoto, '?')) ? "&" : "?";         $insertgoto .= $_server['query_string'];     }     header(sprintf("location: %s", $insertgoto)); } ?> 

make sure code, don't echo statement when using header redirection, , put exit(); next line header statement.

like

//echo 'do not echo statement here'; if uncomment block same error again. header('your location here'); exit(); 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

visual studio - TFS will not accept changes I've made to a Java project -