script error

firman · Aug 10, 2011
Para master saya mau nanya!
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\temanonline\index.php:11) in D:\xampp\htdocs\temanonline\login.php on line 12
kira2 meesti gimana udah di rubah2 tetep error.
ini index.php
<?php session_start();
include "koneksi.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>TemanOnline -- Ri32.Wordpress.Com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="images/CitrusIsland.css" type="text/css" />
<link rel="shortcut icon" href="favicon.gif" type="image/x-icon">
</head>
<body>
<div id="wrap">
  <div id="header">
    <form method="post" class="search" action="?page=login">
      <p>
        Email <input name="email" class="textbox" type="text" /> 
        Password <input name="password" class="textbox" type="password" />
        <input name="search" class="button" value="Login" type="submit" />
      </p>
    </form>
    <h1 id="logo">Teman<span>Online</span></h1>
  </div>
  <div id="menu">
    <ul>
      <li id="current"><a href="index.php">Home</a></li>
    </ul>
  </div>
  <div id="sidebar" >
    <h1>Selamat Datang</h1>
    <p>&quot;Mari bergabung di situs <em>TemanOnline</em> untuk bertemu dengan teman lama dan teman baru di dunia maya...&quot;</p>
    <p class="align-right">- Agus Sumarna</p>
  </div>
  
	<?php 
        if(isset($_GET['page'])){
        	$page=htmlentities($_GET['page']);
        }else{
       		$page="form_daftar";
        }
        
        $file="$page.php";
        $cek=strlen($page);
        
        if($cek>30 || !file_exists($file) || empty($page)){
        	include ("form_daftar.php");
        }else{
        	include ($file);
        }
        ?>
    
  <div id="rightbar">
    <h1>Support</h1>
    <p><img src="images/logo-ri32.jpeg" width="154" height="114" alt="firefox" class="float-left" style="border:none" /></p>
	<p><img src="images/friend_indeed.jpg" width="147" height="133" alt="firefox" class="float-left" style="border:none" /></p>
  </div>
</div>
<div id="footer">
  <div id="footer-content">
    <div id="footer-left"> &copy; Copyright 2011 <strong>Ri32 Project</strong>&nbsp; Design by: <a href="http://www.styleshout.com/">styleshout</a></div>
  </div>
</div>

<!--  PopCalendar(tag name and id must match) Tags should not be enclosed in tags other than the html body tag. -->
<iframe width=174 height=189 name="gToday:normal:./calender/agenda.js" id="gToday:normal:./calender/agenda.js" src="./calender/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
</iframe>

</body>
</html>

sript login.php
<?php
$email=$_POST['email'];
$password=md5($_POST['password']);

$query=mysql_query("select * from tbl_user where email='$email' and password='$password'");
$cek=mysql_num_rows($query);
$row=mysql_fetch_array($query);
$id_user=$row['id_user'];

if($cek){
	$_SESSION['id_user']=$id_user;
 header('Location:home.php');
}else{
	?>
    <div id="main"> <a name="TemplateInfo"></a>
	<blockquote>
	  <p></p>
	  <p><font color="#FF0000">Username atau Password anda salah!!</font>. silahkan ulangi Login</p>
	  <p></p>
	</blockquote>
    </div>
	<?php
}
?>
Silahkan login untuk menjawab!
0
Loading...
burhan · Aug 11, 2011 · 0 Suka · 0 Tidak Suka
kayaknya setelah dionlinekan lancar mas tanpa error seperti kasus saya di sini
http://www.myphptutorials.com/questions/beda-di-localhost-dan-saat-di-onlinekan_204.html

dan errornya di script login pada baris 12 sama seperti di pertanyaanku
header('Location:home.php');


semoga bisa diambil kesimpulan walaupun belum bisa kasih solusi semoga saja membantu
0
Loading...
Ellyx Christian · Aug 11, 2011 · 0 Suka · 0 Tidak Suka
Saya sudah jelaskan penyebabnya di http://www.myphptutorials.com/questions/beda-di-localhost-dan-saat-di-onlinekan_204.html#answer-anc1240
Disini tempat kesalahannya:
<p class="align-right">- Agus Sumarna</p>
 </div>
 
	<?php 
 if(isset($_GET['page'])){
 	$page=htmlentities($_GET['page']);
 }else{
 		$page="form_daftar";
 }
 
 $file="$page.php";
 $cek=strlen($page);
 
 if($cek>30 || !file_exists($file) || empty($page)){
 	include ("form_daftar.php");
 }else{
 	include ($file);
 }
 ?>