Foros del Web » Programando para Internet » PHP »

Errores en php

Estas en el tema de Errores en php en el foro de PHP en Foros del Web. Buenos dias a todos, Tengo unos mensajes de errores que no logro corregir: Notice: Undefined variable: headers in C:\wamp\www\agorario\admin\lembrar_senha.php on line 143 Notice: Undefined variable: ...
  #1 (permalink)  
Antiguo 26/05/2011, 08:38
 
Fecha de Ingreso: julio-2010
Mensajes: 37
Antigüedad: 13 años, 9 meses
Puntos: 2
Errores en php

Buenos dias a todos,

Tengo unos mensajes de errores que no logro corregir:

Notice: Undefined variable: headers in C:\wamp\www\agorario\admin\lembrar_senha.php on line 143

Notice: Undefined variable: nome in C:\wamp\www\agorario\admin\lembrar_senha.php on line 145

este es el codigo

<?php

include("../config.php");

?>



<table width="300" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td colspan="2" align="center" background="<?=$usite?>images/layout/fundo_tela_admin.gif" bgcolor="<?=$corcelula2?>">

<br />

<br />

<table width="275" border="0" cellpadding="0" cellspacing="0">

<tr>

<td align="center"> <img src="<?=$usite?>images/layout/img_logo.png" /><br />

<br />

<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #666666;">

<tr>

<td height="195" align="center" valign="middle" bgcolor="<?=$coronmouse?>">

<form action='lembrar_senha.php' METHOD="post">

<input name="acao" type="hidden" value="send_pass" />

<table border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="130" align="left" valign="middle"><font class="pequeno branco">ID:</font><br />

<input name="codigo" type="text" size="25" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="border:1px solid #666666;" />

<br />

<font class="pequeno branco">E-MAIL:</font><br />

<input name="email" type="text" size="25" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="border:1px solid #666666;" />

<br />

<br />

<input name="logar2" type="submit" value="LEMBRAR SENHA" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="border:1px solid #666666; height: 15px; width:100px; font-size:9px; font-family:Tahoma, Verdana, arial;" /></td>

<td width="85" align="right" valign="middle"><img src="../images/layout/img_login_chaves.png" /></td>

</tr>

<tr>

<td height="32" colspan="2" align="center" valign="middle"><font color="#FF0000" class="titulos">

<?php

if(@$_POST['acao'] == "send_pass"){



$codigo = $_POST['codigo'];

$email = $_POST['email'];



$sql = mysql_query("SELECT * FROM users where id='$codigo' AND email='$email'");

$dados = mysql_fetch_array($sql);



if(mysql_num_rows($sql) == 1){



$admin = $usite."admin/";

$img_logo = $usite."images/layout/img_topo_email.png";

$arquivo = "

<html>

<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>

<tr>

<TD>

<img src='$img_logo'><br>

<br>



<font size='2' face='Tahoma, Arial'>Olá <b>$dados[nome]</b>,<br>

<BR>

Voc&ecirc; solicitou sua senha de acesso no sistema de administração do site <b>$usite</b>.<br>

Sua senha cadastrada em nosso sistema &eacute;: <b>$dados[salvacao]</b><br>

<br>

<br>

<strong>$tsite</strong><br>

<a href='$usite'>$usite</a><br>

</font></td>

</tr>

</table>

</html>

";



$destino = "$dados[email]";

$assunto = "Lembrete de Senha - $usite";



// É necessário indicar que o formato do e-mail é html

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "From: $nome <$email>\r\n";



$email = @mail($destino, $assunto, $arquivo, $headers);

if($email){

echo "

<meta http-equiv='refresh' content='5;URL=index.php'>

<b>Senha enviada para o e-mail cadastrado!</b><br><br>

";

} else {

echo "

<meta http-equiv='refresh' content='5;URL=javascript:history.go(-1)'>

<b>Erro ao enviar senha!</b><br><br>

";

}

} else {

echo "

<meta http-equiv='refresh' content='5;URL=index.php'>

<b>Nenhum e-mail encontrado!</b><br><br>

";

}

}

?>

</font></td>

</tr>



</table>

</form>

</td>

</tr>

</table></td>

</tr>

</table>

<br />

<br />

</font></td>

</tr>

</table>
  #2 (permalink)  
Antiguo 26/05/2011, 08:45
Avatar de scorpion3d  
Fecha de Ingreso: mayo-2011
Mensajes: 92
Antigüedad: 12 años, 11 meses
Puntos: 19
Respuesta: Errores en php

Hola probemos quitarle el punto antes del igual a las siguientes lineas,

Antes:

Código PHP:
Ver original
  1. // É necessário indicar que o formato do e-mail é html
  2.  
  3. $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
  4.  
  5. $headers .= "From: $nome <$email>\r\n";

Despues:

Código PHP:
Ver original
  1. // É necessário indicar que o formato do e-mail é html
  2.  
  3. $headers = "Content-type: text/html; charset=iso-8859-1\r\n";
  4.  
  5. $headers = "From: $nome <$email>\r\n";
__________________
www.elias.com.sv

Etiquetas: errores
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:45.