[RESOLVIDO] Não estou conseguindo exibir os dados do registro específico ( como pesquisar pelo Código )
Estou tentando, mas não esta exibindo o registro...
localizar.php
<?php
session_start();
$_SESSION["localizarfotografia"] = $_POST["codphoto"];
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>EXIBIR FOTOGRAFIA PELO CÓDIGO INTERNO</title>
<style type="text/css">
<!--
.Style6 {font-size: 13px}
.auto-style20 {
text-align: center;
}
.auto-style22 {
background-color: #FEB624;
}
.auto-style23 {
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: xx-small;
text-align: center;
}
.auto-style25 {
background-color: #FFCC66;
}
.auto-style26 {
font-size: x-small;
}
.auto-style27 {
font-size: x-small;
text-align: center;
}
.auto-style28 {
text-align: center;
background-color: #FEB624;
}
-->
</style>
</head>
<body style="margin-top: 50">
<body onload="form1.login.focus();">
<form id="form1" name="form1" method="post" action="pesquisaragora.php">
<div class="auto-style20">
<table align="center" cellpadding="0" cellspacing="0" class="auto-style23" style="width: 500">
<tr>
<td class="auto-style20">
</td>
</tr>
<tr>
<td class="auto-style22">
</td>
</tr>
<tr>
<td class="auto-style25" style="height: 41px">Informe o código
da FOTOGRAFIA abaixo</td>
</tr>
<tr>
<td class="auto-style25">
<table align="center" style="width: 450">
<tr>
<td class="auto-style27"><span class="Style6">
<label>
<input name="codphoto" type="text" id="codphoto" style="width: 305px; height: 83px;" /></label></span></td>
</tr>
<tr>
<td class="auto-style26"><strong>
</strong></td>
</tr>
<tr>
<td class="auto-style20"><span class="Style6">
<label>
<input type="submit" name="Submit" value="LOCALIZAR PHOTO" /></label></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="auto-style25"> </td>
</tr>
<tr>
<td class="auto-style28">
</td>
</tr>
</table>
<br></div>
</form>
</body>
</html>
**pesquisarphoto.php**
<?php
include("config.php");
$codphoto = $_POST['codphoto'];
$sql_logar = "SELECT * FROM photos WHERE codphoto = '$codphoto'";
$exe_logar = mysql_query($sql_logar) or die (mysql_error());
$fet_logar = mysql_fetch_assoc($exe_logar);
$num_logar = mysql_num_rows($exe_logar);
$codphoto = $fet_logar['codphoto'];
$nome = $fet_logar['nome'];
$cidade = $fet_logar['cidade'];
$uf = $fet_logar['uf'];
if ($num_logar == 0){
echo "Desculpe, mas a foto não foi localizada.";
echo "<br><a href='javascript:window.history.go(-1)'>Clique aqui e tente novamente.</a>";
}
else{
session_start();
$_SESSION['codphoto'] = $codphoto;
$nome = $fet_logar['nome'];
$cidade = $fet_logar['cidade'];
$uf = $fet_logar['uf'];
echo $exibir["codphoto"];
echo $exibir["nome"];
echo $exibir["cidade"];
echo $exibir["uf"];
}
?>Discussão (2)
Carregando comentários...