0
클래스가있는 검색 상자를 만들려고합니다. 클래스를 사용하지 않고 항상이 코드를 사용합니다. 코드에서PHP - 검색 상자가 작동하지 않습니다.
function verGaleria() {
$sql = "SELECT * FROM `cds`";
if(($rs=$this->bd->executarSQL($sql))){
if(isset($_GET['buscar'])){
$sql = mysql_query("SELECT * FROM `cds` where name like '%".$_GET['buscar']."%'");
}
while ($row = mysql_fetch_array($rs)) {
$imagem = $row['imagem'];
$ID = $row['ID'];
$artista = $row['artista'];
$preco = $row['preco'];
$titulo = $row['titulo'];
echo '
<style>
.teste{
text-align:center; display: inline-block; width:300px; margin: 0 0 40px 30px; float:left; color:white;
}
</style>
<div class="teste">
<h1>'.$titulo.'</h1>
<h2><img class="cd" src="CDs/'.$imagem.'" width="102" height="126" alt="'.$artista.'"/></h2>
<h3>'.$preco.'€</h3>
</div>
';
}
} else {
return false;
}
}
내 :
<form method="GET" name="buscar" >
<label><a class="utilizador">Procurar</a>
<br />
<input type="text" name="buscar" id="prc" placeholder="Ex: Rock"/></label>
<input type="submit" class="submitprc" value="Pesquisar" />
</form>
으로 문제가 무엇인가? 폼 태그에서 의도적으로'action' 속성을 남겼습니까? –
@ 럭키 소니, 작동하지 않습니다 :) – Atle
@Atle 작동하지 않는 이유는 무엇입니까? 무엇을 할 때 어떻게됩니까? lol –