What's wrong with this code?

wxdqz

New Member
Hello.. I don't know what's wrong here.. can you help me? I keep receiving the message which says there's an error on line 50 but I don't know how to change that.
I will thank any kind of help.
Thanks


<body>Cadastro de usu醨ios<br><br>
<?php
$db= mysql_connect("localhost", "root");
mysql_select_db("cadastro" ,$db);
if ($submit){
if ($atualizar){
$sql = "UPDATE usuarios SET
primeiro_nome='$nome',
sobrenome='$sobrenome',
email='$email' WHERE
id_usuarios=$id";
$result = mysql_query($sql,$db);
echo "Registro atualizado!<p>";?><br>
<a href=http://www.phpbuilder.com/board/archive/index.php/"<php echo $PHP_SELF?>">Voltar para a entrada</a>
<br><?php
}
else {
$sql = "INSERT INTO usuarios VALUES (0,'$nome','$sobrenome','$semail')";
$result=
mysql_query($sql,$db);
echo "Registro gravado!<p>"; ?>
<br><a href=http://www.phpbuilder.com/board/archive/index.php/"<?php echo $PHP_SELF?>">Voltar para a entrada</a>
<br></php }
}
ELSEIF ($palavra) {
echo "Pesquisa efetuada<br><br>";
$sql = "SELECT * FROM usuarios WHERE
primeiro_nome LIKE'%%$chave%%'
OR sobrenome LIKE
'%%$chave%%'
OR EMAIL LIKE
'%%$chave%%';
&result = mysql_query($sql,$db);
while ($myrow = mysql_fetch_array($result)) {
printf(" <a href=http://www.phpbuilder.com/board/archive/index.php/\"%s?id=%s\">Nome: %s
%s - Email: %s</a> \n",
$PHP_SELF,
$myrow["id_usuarios"],
$myrow["primeiro_nome"],
$myrow["sobrenome"],
$myrow["email"]);
printf("<a href=\"%s?id=%s&delete=yes\">(APAGAR) </a><br>",
$PHP_SELF,
$myrow["id_usuarios"]);
}?><br>
<a href="<php echo $PHP_SELF?>">Voltar para a entrada</a>
<br>
<?php }ELSEIF ($delete){
$sql="DELETE FROM usuarios WHERE id_usuarios=$id";
$result=mysql_query($sql,$db);
echo "Registro apagado!<p>";?><br>
<a href="<?php echo $PHP_SELF?>">Voltar para a entrada</a><br>
<?php} else {

<?php
if (!$id) {?>
<form method="post"
action="<?php echo $PHP_SELF?>">
<table>
<tr><td>Palavra-chave:</td><td><input type="Text"
name=chave value=" "></td></tr>
</table><br>
<input type="Submit" name="palavra"
value="Pesquisar">
</form><br>
<?php }?>
<form method="post" action="<?php echo $PHP_SELF?>">
<?php
if($id) {
$sql= "SELECT *FROM usuarios WHERE id_usuarios=$id";
$result = mysql_query($sql,$db);
$myrow = mysql_fetch_array($result);
$id = $myrow["id_usuarios"];
$nome =
$myrow["primeiro_nome"];
$sobrenome =
$myrow["sobrenome"];
$email = $myrow["email"];
?>
<input type=hidden name="id"
value="<?php echo $id ?>">
<input type=hidden name="atualizar" value="sim">
<?php } ?>
Cadastro
<br><br>
<table border=0>
<tr><td>Primeiro nome:</td><td><input type="Text" name="nome" value="<?php echo $nome ?>">
</td></tr>
<tr><td>Sobrenome:</td><td><input type="Text' name="sobrenome" value=http://www.phpbuilder.com/board/archive/index.php/"<?php echo $sobrenome ?>"></td></tr>
<tr><td>Email:</td><td><input type="Text" name="email" value="<?php echo $email ?>"></td></tr></table>
<br><br>
<input type="Submit" name="submit" value="Cadastrar">
</form><br>
<?php } ?>
</body>
 
Back
Top