Ai existe uma pagina com o nome pesquisa.php nela ta tudo beleza. AI tu escreve o que você deseja procurar, ai aparece outra pagina com os resultados, a pagina que aparece é a busca2.php
<?
include "config.inc";
include "conectar.inc";
$sql = mysql_query("Select * from $nometabela where nome = '$nome'");
$resultado=mysql_query("select * from $nometabela where Nome Like'%$busca%'",$conexao);
if(mysql_num_rows($resultado)==0){ ?>
<div align="center">
<b><font size="4">A(s) palavra(s) "<?=$busca?>" não foram encontradas!</font></b>
</div>
<? }else{ ?>
<div align="center">
<font size="4"><b>A(s) palavra(s) "<?=$busca?>" foram encontradas em <?=mysql_num_rows($resultado)?> página<?=mysql_num_rows($resultado)==1?'':'s'?>!</b></font></p>
<? for($i=0;$i<mysql_num_rows($resultado);$i++){
$url = mysql_result($resultado,$i,"url");
$nome = mysql_result($resultado,$i,"nome");
echo "<a href='index.php?mostra'>$nome</a><br>";
"</a><br>";
} ?>
</div>
<? }
mysql_close($conexao);
?>
Ai nessa pagina você clica no link, ai vai pra pagina ver_resultado.php
<?
$con=mysql_connect(host','xxx','xxxx') or die ("erro na conexão");
mysql_select_db('xxxx') or die ("erro ao conectar ao banco");
$sql = mysql_query("Select * from receitas where Nome = '$nome'", $con );
if(mysql_num_rows($sql)>0) {
$i = mysql_fetch_array($sql);
$nome = $i['Nome'];
$ingredientes = $i['Ingredientes'];
$modo = $i['Modo']; } echo"
<p align=\"center\"><font face=\"Comic Sans MS\"><i>Receita Manager 1.0</i></font></p><br>
<font color=#0000FF><b>Nome:</b> </font><font color=#800000><input type=\"text\" name=\"Nome\" value=\"$nome\" size=\"50\"></font><br><br>
<font color=#0000FF><b>Ingredientes:</b> </font><font color=#FF0000><textarea rows=23 name=\"Ingredientes\" cols=72>$ingredientes</textarea></font><br><br>
<font color=#0000FF><b>Modo de Fazer:</b> </font><font color=#008080><textarea rows=\"32\" name=\"Modo\" cols=\"72\">$modo</textarea></font>
<p align=\"center\"><font face=\"Comic Sans MS\"><i>Powered By Fernando</i></font> </p>";
?>
Mais ai nesse ponto da um erro
Warning: Failed opening 'ver_resultado.php?nome=' for inclusion (include_path='.; \apache\includes;\apache\htdocs\;\apache\htdocs\phpmyadmin') in C:\apache\htdocs\receita\pagina\index.php on line 108
Pergunta
gfav
Ai , eu to manipulandoi um codigo em php, ai eu criei a pagina index.php
<html> <head> <meta http-equiv="Content-Language" content="pt-br"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>..:: Receita Manager 1.0 ::..</title> </head> <body bgcolor="#FFFFFF" text="#506090" link="#506090" vlink="#506090" alink="#506090" topmargin="0" leftmargin="0"> <table border="0" cellpadding="0" cellspacing="0" width="780" background="fondoesfer.gif" height="80"> <tr> <td width="87"> <p align="center"><img border="0" src="logo.gif" width="73" height="69"></td> <td width="181" valign="middle"> <b><font size="7" face="Monotype Corsiva">Receita</font></b></td> <td width="15" valign="bottom"> </td> <td width="493" bgcolor="#D0DCF0"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" width="447" bgcolor="#B5C8E8" style="border: 1 solid #506090"> <tr> <td width="12" rowspan="3"> <p align="center"><img border="0" src="escritpublicit.gif" width="12" height="54"></p> </td> <td width="472"><img border="0" src="tamanho.gif" width="3" height="3"></td> <td width="4"><img border="0" src="tamanho.gif" width="3" height="3"></td> </tr> <tr> <td width="472" style="border: 1 solid #506090" height="60"> Banner</td> <td width="4"><img border="0" src="tamanho.gif" width="3" height="3"></td> </tr> <tr> <td width="472"><img border="0" src="tamanho.gif" width="3" height="3"></td> <td width="4"><img border="0" src="tamanho.gif" width="3" height="3"></td> </tr> </table> </center> </div> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="780" background="fundofaixatop.gif" height="26"> <tr> <td valign="bottom"> <font size="1" face="Arial" color="#FFFFFF">Desenvolvido por Web Raf</font></td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="780"> <tr> <td width="80" valign="top" bgcolor="#B5C8E8"> <table border="0" cellpadding="0" cellspacing="0" width="139" bgcolor="#D0DCF0"> <tr> <td width="137" bgcolor="#B5C8E8"><b><font face="Arial" size="2">> Título</font></b></td> </tr> <tr> <td width="137"><font size="1" face="Arial"> ::.<a href="index.php?inicio"> Home</a></font></td> </tr> <tr> <td width="137"><font size="1" face="Arial"> ::.<a href="mailto:HHH@HHH.com.br"> Contato</a></font></td> </tr> <tr> <td width="137" bgcolor="#B5C8E8"><b><font face="Arial" size="2">> Seções</font></b></td> </tr> <tr> <td width="137"><font size="1" face="Arial"> ::.<a href="index.php?pesquisa"> Pesquisa de Receita</a></font></td> </tr> <tr> <td width="137"><font size="1" face="Arial"> ::. <a href="index.php?livro">Guestbook - Assine</font></td> </tr> <tr> <td width="137" bgcolor="#B5C8E8"><font face="Arial" size="2"><b>> Outros</b></font></td> </tr> <tr> <td width="137"> <p align="center" style="margin-top: 0; margin-bottom: 0"><img border="0" src="tamanho.gif" width="2" height="2"></p> <p align="center" style="margin-top: 0; margin-bottom: 0"><img border="0" src="http://www.webraf.hpg.com.br/selo.gif"></p> <p align="center" style="margin-top: 0; margin-bottom: 0"><img border="0" src="tamanho.gif" width="2" height="2"></td> </tr> </table> </td> <td width="696" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="641" style="border: 4 solid #FFFFFF" bgcolor="#D0DCF0"> <tr> <td width="626"> <p align="center"><font size="2" face="Arial"> <? $qstring=split("&", $QUERY_STRING); $acao=$qstring[0]; if ($acao == livro){ include "index.php"; } if ($acao == pesquisa){ include "pesquisa.php"; } if ($acao == busca){ include "busca2.php"; } if ($acao == mostra){ include "ver_resultado.php?nome=$nome"; } ?> </font></p> <p align="center"><font size="2" face="Arial"></font></td> </tr> </table> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="780" height="26"> <tr> <td background="fundofaixatop.gif"> </td> </tr> </table> </body> </html>Ai existe uma pagina com o nome pesquisa.php nela ta tudo beleza. AI tu escreve o que você deseja procurar, ai aparece outra pagina com os resultados, a pagina que aparece é a busca2.php<? include "config.inc"; include "conectar.inc"; $sql = mysql_query("Select * from $nometabela where nome = '$nome'"); $resultado=mysql_query("select * from $nometabela where Nome Like'%$busca%'",$conexao); if(mysql_num_rows($resultado)==0){ ?> <div align="center"> <b><font size="4">A(s) palavra(s) "<?=$busca?>" não foram encontradas!</font></b> </div> <? }else{ ?> <div align="center"> <font size="4"><b>A(s) palavra(s) "<?=$busca?>" foram encontradas em <?=mysql_num_rows($resultado)?> página<?=mysql_num_rows($resultado)==1?'':'s'?>!</b></font></p> <? for($i=0;$i<mysql_num_rows($resultado);$i++){ $url = mysql_result($resultado,$i,"url"); $nome = mysql_result($resultado,$i,"nome"); echo "<a href='index.php?mostra'>$nome</a><br>"; "</a><br>"; } ?> </div> <? } mysql_close($conexao); ?>Ai nessa pagina você clica no link, ai vai pra pagina ver_resultado.php<? $con=mysql_connect(host','xxx','xxxx') or die ("erro na conexão"); mysql_select_db('xxxx') or die ("erro ao conectar ao banco"); $sql = mysql_query("Select * from receitas where Nome = '$nome'", $con ); if(mysql_num_rows($sql)>0) { $i = mysql_fetch_array($sql); $nome = $i['Nome']; $ingredientes = $i['Ingredientes']; $modo = $i['Modo']; } echo" <p align=\"center\"><font face=\"Comic Sans MS\"><i>Receita Manager 1.0</i></font></p><br> <font color=#0000FF><b>Nome:</b> </font><font color=#800000><input type=\"text\" name=\"Nome\" value=\"$nome\" size=\"50\"></font><br><br> <font color=#0000FF><b>Ingredientes:</b> </font><font color=#FF0000><textarea rows=23 name=\"Ingredientes\" cols=72>$ingredientes</textarea></font><br><br> <font color=#0000FF><b>Modo de Fazer:</b> </font><font color=#008080><textarea rows=\"32\" name=\"Modo\" cols=\"72\">$modo</textarea></font> <p align=\"center\"><font face=\"Comic Sans MS\"><i>Powered By Fernando</i></font> </p>"; ?>Mais ai nesse ponto da um erro
alguém sabe onde esta o erro ???
Valeuuuu
Link para o comentário
Compartilhar em outros sites
17 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.