İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

php - bu hata nedir?

Lonely16

0
İyinet Üyesi
Katılım
13 Ekim 2007
Mesajlar
266
Reaction score
0
PHP:
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\youtube.php:8) in C:\AppServ\www\youtube.php on line 10

yukardaki hata nedir arkadaşlar.youtube videolarını indirmek için internetten bulduğum kodlarla yapmaya çalışıyorum ama bu hatayı veriyor download yaparkene??
 

raptor

0
İyinet Üyesi
Katılım
7 Ekim 2006
Mesajlar
853
Reaction score
0
header("Location: xxx"); böyle bir kod varmı dosyada.
 

raptor

0
İyinet Üyesi
Katılım
7 Ekim 2006
Mesajlar
853
Reaction score
0
onun yerine böyle yaparsan hata vermez sanırım
PHP:
echo "<script language=\"JavaScript\">window.location.href = '$url';</script>";
 

Lonely16

0
İyinet Üyesi
Katılım
13 Ekim 2007
Mesajlar
266
Reaction score
0
PHP:
Parse error: syntax error, unexpected ':' in C:\AppServ\www\you.php on line 10

böle bi hata verio belkide ben yanlış yapıyorum :)

orjinali budur.

PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
   <?
    if ($_POST[git] == 'ok'){
    header("Location: http://rd.cache.l.google.com/get_video?video_id=$_POST[video_id] ");
    }
    echo '<form method="POST" action="youtube.php">'."\n";
    echo '  <input type="text" name="video_id" size="22">'."\n";
    echo '  <input type="hidden" name="git" size="22" value="ok">'."\n";
    echo '  <input type="submit" value="Gönder" name="B1">'."\n";
    echo '</form>'."\n";
?> 

</body>
</html>

Değiştirdiğim...

PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
   <?
    if ($_POST[git] == 'ok') echo "<script language=\"JavaScript\">window.location.href = '$url';</script>";  
http://rd.cache.l.google.com/get_video?video_id=$_POST[video_id] ");
    }
    echo '<form method="POST" action="you.php">'."\n";
    echo '  <input type="text" name="video_id" size="22">'."\n";
    echo '  <input type="hidden" name="git" size="22" value="ok">'."\n";
    echo '  <input type="submit" value="Gönder" name="B1">'."\n";
    echo '</form>'."\n";
?> 

</body>
</html>
 

GNeRaL

0
İyinet Üyesi
Katılım
24 Şubat 2005
Mesajlar
2,869
Reaction score
18
Konum
Samsun
http://rd.cache.l.google.com/get_video?video_id=$_POST[video_id] ");
bu satır??

bunu kaldırman gerekiyor sanırım...
 

Lonely16

0
İyinet Üyesi
Katılım
13 Ekim 2007
Mesajlar
266
Reaction score
0
onu kaldırırsam down etmez sanırım.kaldırdım gene olmadı.
 

raptor

0
İyinet Üyesi
Katılım
7 Ekim 2006
Mesajlar
853
Reaction score
0
hata vermesi normal http://rd.cache.l.google.com/get_video?video_id=$_POST[video_id] "); bu satır olmayacak. benim koddaki $url yerine yazacaksın o satırı.
 

raptor

0
İyinet Üyesi
Katılım
7 Ekim 2006
Mesajlar
853
Reaction score
0
PHP:
$url = 'http://rd.cache.l.google.com/get_video?video_id='.$_POST[video_id].'';
echo "<script language=\"JavaScript\">window.location.href = '$url';</script>";

böyle yapman yeterli.
 

GNeRaL

0
İyinet Üyesi
Katılım
24 Şubat 2005
Mesajlar
2,869
Reaction score
18
Konum
Samsun
Yani şöyle dener misin bir;

if ($_POST[git] == 'ok') echo "<script language=\"JavaScript\">window.location.href = 'http://rd.cache.l.google.com/get_video?video_id=$_POST[video_id]';</script>";
 

Lonely16

0
İyinet Üyesi
Katılım
13 Ekim 2007
Mesajlar
266
Reaction score
0
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
   <?
    if ($_POST[git] == 'ok') echo "<script language=\"JavaScript\">window.location.href = 'http://rd.cache.l.google.com/get_video?video_id=$_POST[video_id]");';</script>";
    }
    echo '<form method="POST" action="you.php">'."\n";
    echo '  <input type="text" name="video_id" size="22">'."\n";
    echo '  <input type="hidden" name="git" size="22" value="ok">'."\n";
    echo '  <input type="submit" value="Gönder" name="B1">'."\n";
    echo '</form>'."\n";
?> 

</body>
</html>


Yapamadım gene hatam nerde :(

edit:mad:GNeRaL ölede denedim olmadı :(

PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
   <?
    if ($_POST[git] == 'ok') echo "<script language=\"JavaScript\">window.location.href = 'http://rd.cache.l.google.com/get_video?video_id=$_POST[video_id]';</script>";
    }
    echo '<form method="POST" action="you.php">'."\n";
    echo '  <input type="text" name="video_id" size="22">'."\n";
    echo '  <input type="hidden" name="git" size="22" value="ok">'."\n";
    echo '  <input type="submit" value="Gönder" name="B1">'."\n";
    echo '</form>'."\n";
?> 

</body>
</html>
 

raptor

0
İyinet Üyesi
Katılım
7 Ekim 2006
Mesajlar
853
Reaction score
0
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
   <?
    if ($_POST[git] == 'ok') {
$url = 'http://rd.cache.l.google.com/get_video?video_id='.$_POST[video_id].'';
echo "<script language=\"JavaScript\">window.location.href = '$url';</script>";
    }
    echo '<form method="POST" action="you.php">'."\n";
    echo '  <input type="text" name="video_id" size="22">'."\n";
    echo '  <input type="hidden" name="git" size="22" value="ok">'."\n";
    echo '  <input type="submit" value="Gönder" name="B1">'."\n";
    echo '</form>'."\n";
?> 

</body>
</html>

böyle olması lazım.
 

Lonely16

0
İyinet Üyesi
Katılım
13 Ekim 2007
Mesajlar
266
Reaction score
0
biraz uraştıktan sonra oldu teşekkür ederim @raptor. @GNeRaL sanada teşekkür ederim :)
 

sempaty

1
İyinet Üyesi
Katılım
25 Şubat 2005
Mesajlar
3,824
Reaction score
19
Konum
hawaii. ama sanal tur.
HTML:
<?
    if ($_POST[git] == 'ok'){ 
    header("Location: http://rd.cache.l.google.com/get_video?video_id=$_POST[video_id] "); 
    } 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<title>Untitled Document</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 
<body> 
   <? 
    echo '<form method="POST" action="youtube.php">'."\n"; 
    echo '  <input type="text" name="video_id" size="22">'."\n"; 
    echo '  <input type="hidden" name="git" size="22" value="ok">'."\n"; 
    echo '  <input type="submit" value="Gönder" name="B1">'."\n"; 
    echo '</form>'."\n"; 
?>  

</body> 
</html>
bu şekilde uyarı vermemesi gerek.
header() dan önce html kullanılmaması gerek bir anlamda.
 

Lonely16

0
İyinet Üyesi
Katılım
13 Ekim 2007
Mesajlar
266
Reaction score
0
Bayağı bi acemi olduğum için geç jeton düştü :(( teşekkür ederim iLk defa başlıyorum php'ye yavaş yavaş sökcez inş...
 

hakimi

0
İyinet Üyesi
Katılım
1 Temmuz 2006
Mesajlar
1,356
Reaction score
0
en tepeye ob_start(); koysaydın header hatası almazdın :) uğraşmana de gerek kalmazdı :)
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Üst