Kodları lütfen aşağıdaki butonları kullanarak renklendirin. Örnek: <php> echo "Selam Dünya"; </php>
Yardım
karakter kaldı

while yardım

merhaba. Benim bir sorum olucak. head bölümünde title'da aramanın ismini yazdırıyorum bunun için while'ı yukarı yazıyorum. Yani head kodu öncesinden yazıyorum. Sonra ?> getirerek kapatıyorum ama } koymuyorum çünkü o while üzerinde yazdırmam gerekiyor. aşağıda tekrar <? koduyla yazdırıyorum arama sonuçlarını. arama sonucunu tarattığımda hepsini alıyor... Resimdeki gibi bir hale geliyor oysaki ben phpde sadece o siyah kutucukları echo olarak yazdırmıştım fakat hepsini alıyor echo olarak...

While ı geçici olarak nasıl kapatabilirim. Mesela title'dan sonra basıl while ı kapatabilirim. } yapıyorum fakat bu sefer while'ın devamını nasıl ettiricem onu bilmiyorum... :?
<?php include('mysql.php'); ?><?

mysql_query("SET NAMES 'utf8'");
$search=$_POST["search"];


//Unutmayın! Bu php kodları içinde ki "makaleler" ve "makale" kısımlarıi,veritabanında önceden oluşturduğum tablo ve veri tabanı isimleri.
$result = mysql_query("SELECT * FROM music WHERE musicname LIKE '%$search%'");
  while($r=mysql_fetch_array($result))
{ 
  
   ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Listen Music. Download Free Music. Upload Music."  />
<meta name="keywords" content="listen,music,download,free,upload,fizy,<? echo ''.$search.''; ?>"  />

<title><? echo ''.$search.'';  ?> - </title>
<style type="text/css">

body, html {
	font-family:Arial, Helvetica, sans-serif;
	width:100%;
	margin:0;
	padding:0;
	text-align:center;
	font-size: 18px;
}



.sadasda {
	font-weight: bold;
}
.vcx {
	font-weight: bold;
	color: #03F;
}
.giris {	width: 80px;
	height: 40px;
text-decoration: none;
border-left: 0px; 
padding-left:0px;  
border-right: 0px; 
border-top: 0px;  
border-bottom: 0px; 
padding-bottom: 0px;  
padding-top: 0px;
background-image : url('_img/button.png'); 
cursor : pointer
font-weight: bold;
font-size:18px;
	color: #FFF;
}
.searchbox {	width: 320px;
	height: 31px;
text-decoration: none;
border-left: 0px; 
padding-left:0px;  
border-right: 0px; 
border-top: 0px;  
border-bottom: 0px; 
padding-bottom: 0px;  
padding-top: 0px;
background-image : url('_img/searchbg.png'); 
cursor : pointer
font-weight: bold;
font-size:16px;
	
}
</style>
</head>

<body>
<div id="menu">
	<div class="content"><table width="960" height="40">
	  <td width="422" align="left"><a href="../index.php" title="Index"><img src="_img/logo.png" width="220" height="40" onmouseover="this.src='_img/logo.png';" onmouseout="this.src='_img/logo.png';" /></a><a href="index.php" title="Music Index"><img src="_img/logomusic.png" width="200" height="40" onmouseover="this.src='_img/logomusic.png';" onmouseout="this.src='_img/logomusic.png';" /></a></td><td width="526" align="right"><a href="upload.php" title="Upload"><img src="_img/upload.png" width="100" height="40" onmouseover="this.src='_img/upload1.png';" onmouseout="this.src='_img/upload.png';" /></a></td></table>
  </div>
</div>
<div id="content">
	<div class="content"><table width="960" height="500"><tr align="left" valign="top"><td align="center" valign="top">
<p> </p>
<p>Search Music Again<br />
  <img src="_img/altbaslik.png" alt="" width="250" height="14" /></p>
<form id="form1" name="form1" method="post" action="search.php">
  <p>
    <label>
      <input name="search" type="text" id="search" value=""  class="searchbox" />
    </label>
  </p>
  <p>
    <label>
      <input type="submit" name="submit" id="submit" value="" class="giris"  />
    </label>
  </p>
</form>
<p></p>
<p>  </p>
<p>Music Results<br />
  <img src="_img/altbaslik.png" width="250" height="14" /></p>
 <?php  $bulunan++;
   $bulunan=0;

   $musicname=$r["musicname"];
   $id=$r["id"];
   $url=$r["id"]; 
     
   ?><table width="700" border="0" align="center">
<?php
    //yazdırıyorum.
echo '<tr background="_img/result.png"><td align="center" border="0" width="350" height="30">';
   echo ''.$musicname.'</td><td border="0" align="center" width=200">';
   echo '<object type="application/x-shockwave-flash" data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" width="200" height="20">
    <param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" />
    <param name="bgcolor" value="#ff2114" />
    <param name="FlashVars" value="mp3=mp3/'.$file.'&showloading=always&loadingcolor=a8a8a8&bgcolor=ff2114&bgcolor1=ff2114&sliderovercolor=737373&buttonovercolor=a6a6a6" />
</object>
    ';
   echo '<td border="0" align="center" width="40" height="30"><a href="mp3/'.$file.'" ><img src="_img/download.png" height="30" > </a></td></tr>';
     
}

?>
</table></td></table></div>
</div>


</body>
</html>

Ekli Dosyalar

+0
-0
Cevaba KatılıyorumKatılmıyorum
Cevap Yaz Yorum Yaz Arşivime Ekle Takip Et

Doğru Cevap

  • tapsin adlı üyenin fotoğrafı
    12 yıl önce yazılmış
    147 cevap - 0 soru
    <?php include('mysql.php'); ?><?

    mysql_query("SET NAMES 'utf8'");
    $search=$_POST["search"];


    //Unutmayın! Bu php kodları içinde ki "makaleler" ve "makale" kısımlarıi,veritabanında önceden oluşturduğum tablo ve veri tabanı isimleri.
    $result = mysql_query("SELECT * FROM music WHERE musicname LIKE '%$search%'");
    while($r=mysql_fetch_array($result))
    {

    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="Listen Music. Download Free Music. Upload Music." />
    <meta name="keywords" content="listen,music,download,free,upload,fizy,<? echo ''.$search.''; ?>" />

    <title><? echo ''.$search.''; ?> - </title>

    <?php } ?>

    son eklediğim kapatma tagını koymamışsın
    • spywaredz adlı üyenin fotoğrafı spywaredz
      Daha aşağılara inip bakarsan kapatma tagı var zaten...
      12 yıl önce yazılmış
    • tapsin adlı üyenin fotoğrafı tapsin
      Tam olarak ne hatası aldığınızı ve görsel olarak görme imkanımız var ise özel mesaj ile yazarmısınız çözümü bulalım
      12 yıl önce yazılmış

Cevaplar

Hiç cevap bulunamadı.