Guest asgarotasmeadoram@yahoo.com.br Postado Junho 6, 2005 Denunciar Share Postado Junho 6, 2005 Na parte em vermelho,abaixo, tem um sendmail em php q não consigo fazer funcionar. Por favor me ajudem.<?phpsession_start();include("admin/config.php");include( "admin/settings.inc.php");include( "header.inc.php");include( "shoppingcart.php");$cart = new Cart;include("subheader.inc.php");// start bordersb("100%",$la_fp_reset_pass,$colour_1,$bg_colour); // if customer has clicked submit reset if($reset) { // Generate random password $chars = array( "a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J", "k","K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T", "u","U","v","V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8", "9","0"); $max_chars = count($chars) - 1; srand((double)microtime()*1000000); for($i = 0; $i < 8; $i++) { $new_pass = ($i == 0) ? $chars[rand(0, $max_chars)] : $new_pass . $chars[rand(0, $max_chars)]; } // Check e-mail address is valid if (ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email)) { $stop = 0; } else { print "<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><Br><br><font color=red'>$la_customer_email_inval</font><br><br><a href=\"forgot_pass.php?session=$session\" target=\"_self\">$la_customer_try_again</a></p><br><br>"; $stop = 1;eb($bg_colour,$colour_1);include( "subfooter.inc.php");exit;}// Check email address is held in database$result = mysql_query ("select email from ".$prefix."store_customer where email = '$email'");$count_results = mysql_num_rows($result);if ($count_results > 0) { $stop = 0; } else { $stop = 1; echo"<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><Br><br><b>$email</b> $la_fp_email_no_exist<Br><Br>$la_fp_email_ent_cor<br><br><a href=\"forgot_pass.php?session=$session\" target=\"_self\">$la_customer_try_again</a></p><br><br>"; } while ($joao = mysql_fetch_array($result)) { $email=$joao["email]; } // If all is ok encrypt password in database and send new password to the users email address if ($stop <> 1) { $passwd = md5($new_pass); $res = mysql_query ("update ".$prefix."store_customer set password='$passwd' where email = '$email'"); if ($res) { echo "<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><br><br>$la_fp_email_new_temp <b>$email</b><Br>$la_fp_change_sec</p><br><br>"; $sendto = $email; $from = $site_email; $subject = "$la_fp_fog_pass"; $message = "$la_account_dear $email,\n\n$la_fp_mail_new_pass $new_pass. $la_fp_mail_change \n\n$la_account_ending \n\n$site_business\n\n$la_fp_follow_link\n****************************************************************\n$site_url/new_pass.php?temp=$new_pass&email=$email&language=$session_lang\n*****************************************************************\n\n$la_fp_fail_link\n\n$site_url/account.php"; $headers = "From: $site_email\r\n"; // send e-mail mail($sendto, $subject, $message, $headers); } }}//end if submit// reset password form before submitif(!$reset) { echo"<div align=\"center\"><br><br> <form method=\"post\" enctype=\"multipart/form-data\" action=\"forgot_pass.php\"> <table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"> <tr> <td colspan=\"2\" width=\"400\" height=\"10\"><b>$la_fp_lost_pass</b></td> </tr> <tr> <td colspan=\"2\" width=\"400\" height=\"10\">$la_fp_explain</td> </tr> <tr> <td width=\"100\" height=\"10\">$la_customer_email</td> <td height=\"10\" width=\"300\"> <input type=\"text\" class=\"textbox\" name=\"email\"> </td> </tr> <tr> <td width=\"100\" height=\"10\"></td> <td height=\"10\" width=\"300\"> <input type=\"submit\" name=\"reset\" class=\"submit\" value=\"$la_send_pass\"> </td> </tr> <tr> <td colspan=\"2\" height=\"10\"> </td> </tr> </table> </form> </div>";}// end if submiteb($bg_colour,$colour_1);include("subfooter.inc.php");include("footer.inc.php");?> Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 adailton Postado Junho 6, 2005 Denunciar Share Postado Junho 6, 2005 Coloque as strings com delimitador...tipo $sendto = $email;$from = $site_email;faz$sendto = "$email";$from = "$site_email";Tenta...Qualquer coisa postaAdailton Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Guest asgarotasmeadoram@yahoo.com.br
Na parte em vermelho,abaixo, tem um sendmail em php q não consigo fazer funcionar. Por favor me ajudem.
<?php
session_start();
include("admin/config.php");
include( "admin/settings.inc.php");
include( "header.inc.php");
include( "shoppingcart.php");
$cart = new Cart;
include("subheader.inc.php");
// start border
sb("100%",$la_fp_reset_pass,$colour_1,$bg_colour);
// if customer has clicked submit reset
if($reset)
{
// Generate random password
$chars = array(
"a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J", "k","K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T", "u","U","v","V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8",
"9","0");
$max_chars = count($chars) - 1;
srand((double)microtime()*1000000);
for($i = 0; $i < 8; $i++)
{
$new_pass = ($i == 0) ? $chars[rand(0, $max_chars)] : $new_pass . $chars[rand(0, $max_chars)];
}
// Check e-mail address is valid
if (ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
{
$stop = 0;
}
else
{
print "<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><Br><br><font color=red'>$la_customer_email_inval</font><br><br><a href=\"forgot_pass.php?session=$session\" target=\"_self\">$la_customer_try_again</a></p><br><br>";
$stop = 1;
eb($bg_colour,$colour_1);
include( "subfooter.inc.php");
exit;
}
// Check email address is held in database
$result = mysql_query ("select email from ".$prefix."store_customer where email = '$email'");
$count_results = mysql_num_rows($result);
if ($count_results > 0)
{
$stop = 0;
} else
{
$stop = 1;
echo"<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><Br><br><b>$email</b> $la_fp_email_no_exist<Br><Br>$la_fp_email_ent_cor<br><br><a href=\"forgot_pass.php?session=$session\" target=\"_self\">$la_customer_try_again</a></p><br><br>";
}
while ($joao = mysql_fetch_array($result))
{
$email=$joao["email];
}
// If all is ok encrypt password in database and send new password to the users email address
if ($stop <> 1)
{
$passwd = md5($new_pass);
$res = mysql_query ("update ".$prefix."store_customer set password='$passwd' where email = '$email'");
if ($res)
{
echo "<br><br><p align=\"center\"><b>$la_fp_fog_pass</b><br><br>$la_fp_email_new_temp <b>$email</b><Br>$la_fp_change_sec</p><br><br>";
$sendto = $email;
$from = $site_email;
$subject = "$la_fp_fog_pass";
$message = "$la_account_dear $email,\n\n$la_fp_mail_new_pass $new_pass. $la_fp_mail_change \n\n$la_account_ending \n\n$site_business\n\n$la_fp_follow_link\n****************************************************************\n$site_url/new_pass.php?temp=$new_pass&email=$email&language=$session_lang\n*****************************************************************\n\n$la_fp_fail_link\n\n$site_url/account.php";
$headers = "From: $site_email\r\n";
// send e-mail
mail($sendto, $subject, $message, $headers); }
}
}//end if submit
// reset password form before submit
if(!$reset)
{
echo"<div align=\"center\"><br><br>
<form method=\"post\" enctype=\"multipart/form-data\" action=\"forgot_pass.php\">
<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">
<tr>
<td colspan=\"2\" width=\"400\" height=\"10\"><b>$la_fp_lost_pass</b></td>
</tr>
<tr>
<td colspan=\"2\" width=\"400\" height=\"10\">$la_fp_explain</td>
</tr>
<tr>
<td width=\"100\" height=\"10\">$la_customer_email</td>
<td height=\"10\" width=\"300\">
<input type=\"text\" class=\"textbox\" name=\"email\">
</td>
</tr>
<tr>
<td width=\"100\" height=\"10\"></td>
<td height=\"10\" width=\"300\">
<input type=\"submit\" name=\"reset\" class=\"submit\" value=\"$la_send_pass\">
</td>
</tr>
<tr>
<td colspan=\"2\" height=\"10\">
</td>
</tr>
</table>
</form>
</div>";
}// end if submit
eb($bg_colour,$colour_1);
include("subfooter.inc.php");
include("footer.inc.php");
?>
Link para o comentário
Compartilhar em outros sites
1 resposta 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.