Warning: Cannot modify header information in a register forum
<pre><code>&lt;?php session_start(); ?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
 &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;link href="css/css.css" rel="stylesheet" type="text/css" /&gt;
 &lt;style rel="stylesheet" type="text/css"&gt;   &lt;---------------------------------8 th line
input {
  border-style: solid;
   border-color: #000000;
    border-width: 1px;
   background-color: #ffffff;
   }
 &lt;/style&gt;
 &lt;script src="js/css_browser_selector.js" type="text/javascript"&gt;&lt;/script&gt;

 &lt;/head&gt;

  &lt;body&gt;
&lt;?php 

include('includes/topmenu.php');//top menu

 $yourname='';
 $email='';
 $email2='';
 $password='';
 $password2='';
 $country='';


 $error = array();

 if (isset($_POST['Registerme']))
 { 
include('includes/config.php');
$yourname=$_POST['yourname'];
$email=$_POST['email'];
$email2=$_POST['email2'];
$password=$_POST['password'];
$password2=$_POST['password2'];
$country=$_POST['country'];

$yourname=stripslashes($yourname);
$yourname=mysql_real_escape_string($yourname);
$email = stripslashes($email);
$password= stripslashes($password);
 $email = mysql_real_escape_string($email);
 $password= mysql_real_escape_string($password);




if($yourname==''){

    $error[0]='&lt;span style=color:#ff0000; &gt;name required&lt;/span&gt;';

    } 


if($email==''){

    $error[1]='&lt;span style=color:#ff0000; &gt;email required&lt;/span&gt;';

    } 
if($email2==''){

    $error[2]='&lt;span style=color:#ff0000; &gt;required field&lt;/span&gt;';

    } 


if($password==''){

    $error[3]='&lt;span style=color:#ff0000; &gt;password required&lt;/span&gt;';

    } 


    if($password2==''){

    $error[4]='&lt;span style=color:#ff0000; &gt;required field&lt;/span&gt;';

    } 


if($country==''){

    $error[5]='&lt;span style=color:#ff0000; &gt;country required&lt;/span&gt;';

    } 

if ($password !== $password2) {
    $error[3]='&lt;span style=color:#ff0000; &gt;passwords do not match&lt;/span&gt;';

      }

if ($email !== $email2) {
    $error[1]='&lt;span style=color:#ff0000; &gt;emails do not match&lt;/span&gt;';

           }


           if(count($error) &gt; 0) {  


           } else {
          $password='';
              $id33='';
       $yourname=$_POST["yourname"]; 
       $email=$_POST["email"]; 
       $password=$_POST["password"]; 
       $ip=$_SERVER['REMOTE_ADDR'];
       $country=$_POST["country"]; 

       include('includes/config.php');

         $result = mysql_query("
        INSERT INTO `users` 
       (  
        `email`, `password`, `yourname`, `country`,`ip`)
        VALUES (  '$email', '$password', '$yourname', '$country','$ip')")
            or die (mysql_error());

        $id33= mysql_insert_id(); 

    $result3 = mysql_query("INSERT INTO `other_user_text` (`userid`)
         VALUES ( '$id33');") or die (mysql_error());

            $_SESSION['show']='1';
            mkdir("users/$id33/",0755); 
            mkdir("users/$id33/images",0755); 
            mkdir("users/$id33/thumbs",0755); &lt;-----------------------139th line
            mkdir("users/$id33/thumbs/small_thumbs",0755); 
            header( "Location: login.php" ); 
         }  
  }
?&gt;
</code></pre>

<p>this is my script and when someone registered in my, site broswer is not directing to login .php. shows this error</p>

<p>Warning: Cannot modify header information - headers already sent by (output started at /home/cham1992/public_html/register.php:8) in /home/cham1992/public_html/register.php on line 139</p>

<p>i tried everything ,but i can 't find what is the error here.what's wrong with this page?</p>
