Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Codigos:
pesquisar.php (o formulario)
<?php
include("configuração.php");
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Pesquisa - <?php echo $exercito ?></title>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
</head>
<body>
<font style="text-shadow:2px 0px -2px #FF0000, -2px 0px -2px #00FFFF"><h1><? echo $exercito ?> - Pesquisa</h1></font><br><br>
<form method="POST" action=pesquisa.php>
<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="112"><b>Usuário:</b></td>
<td width="188"><input name="nome" type="text" class="textfield" id="login" /></td>
</tr>
<td> </td>
<td><input type="submit" name="Submit" value="Pesquisar" /></td>
</tr>
</table>
</form>
</body></html>
O codigo que da erro (pesquisa.php):
<?php
include('configuração.php');
$user = $_GET['nome'];
$nome_file = "passwords/$user.php";
if(file_exists($nome_file)){
echo "!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>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>Pesquisa - <?php echo $exercito ?></title>
<link href='loginmodule.css' rel='stylesheet' type='text/css' />
</head>
<body><h1><font style='text-shadow:2px 0px -2px #FF0000, -2px 0px -2px #00FFFF'><? echo $exercito ?></font></h1><p align='center'> </p><h4 align='center' class='err'>Usuário existe! <br><a href='index.php'>Home</a> | <a href='cadastro.php'>Cadastrar</a> | <a href='pesquisa.php'>Pesquisar</a><br><br>
<img src='http://www.habbo.com.br/habbo-imaging/avatarimage?user=$user>'><br><a href='http://www.habbo.com.br/home/$user'>$user</a> <br></h4></body></html>";
}
else{
echo "!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>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>Pesquisa - <?php echo $exercito ?></title>
<link href='loginmodule.css' rel='stylesheet' type='text/css' />
</head>
<body><h1><font style='text-shadow:2px 0px -2px #FF0000, -2px 0px -2px #00FFFF'><? echo $exercito ?></font></h1><p align='center'> </p><h4 align='center' class='err'>Usuário <font color="red">NÃO</font> existe! <br><a href='index.php'>Home</a> | <a href='cadastro.php'>Cadastrar</a> | <a href='pesquisa.php'>Pesquisar outro usuario</a></h4></body></html>";
}
?>
configuração.php:
<?php
$exercito = "FBI Forças Armadas"
?>
loginmodule.css:
body {
font: 11px Verdana, Arial, Helvetica, sans-serif;
color: #666666;
margin: 0px;
padding: 20px 10px 0px;
}
.textfield {
font-size: 11px;
color: #333333;
background: #F7F7F7;
border: 1px solid #CCCCCC;
padding-left: 1px;
}color: #333333;
margin: 0px 0px 5px;
padding: 0px 0px 3px;
font: bold 18px Verdana, Arial, Helvetica, sans-serif;
border-bottom: 1px dashed #E6E8ED;
}color: #2D3954;
font-size: 11px;
}color: #99CC00;
}
.err {
color: #FF9900;
}font-weight: bold;
text-align: left;
}
O erro:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\Arquivos de programas\VertrigoServ\www\exercito\pesquisa.php on line 24
Carregando comentários...