| Autor | Zpráva | ||
|---|---|---|---|
| kuba95 Profil |
#1 · Zasláno: 10. 9. 2011, 19:18:15
Ahoj,
mám script na odeslání mailu, ale script mi z nějakého důvodu email nepošle... mohl by mi někdo pomoct?? Předem díky Script: <?
session_start();
include "config.php";
global $c,$loggedin;
include "data.php";
global $config;
include "funciones.php";
?>
<? include "header2.php"; ?>
<h3>Forgot Password</h3>
<?php
if($_POST)
{
$code = $_POST["code"];
$email = $_POST["email"];
$emailx = mysql_query("SELECT COUNT(*) AS cnt FROM tb_users WHERE email='{$_POST['email']}'");
$emailx = mysql_fetch_array($emailx);
$emailx = $emailx["cnt"];
$errormsg = false;
if($_SESSION['string'] != $code)
{
$error = 1;
$errormsg .= "<b>Error -</b> The captcha was entered incorrectly.<br />";
}
if(!$code)
{
$error = 1;
$errormsg .= "<b>Error -</b> The captcha was entered incorrectly.<br />";
}
if(!$email)
{
$error = 1;
$errormsg .= "<b>Error -</b> The email was not supplied.<br />";
}
if(!$emailx)
{
$error = 1;
$errormsg .= "<b>Error -</b> No account was found with that email address.<br />";
}
if($_SESSION['next_reseptsend'] != 0)
{
$error = 1;
$errormsg .= "<b>Error -</b> You have already made a password retrieval within the last 15 minutes.<br />";
}
$_SESSION['string'] = false;
if($error)
{
print $errormsg."<br><br>";
} else {
$s = mysql_query("SELECT * FROM tb_users WHERE email='{$_POST['email']}'");
$x = mysql_fetch_array($s);
$_SESSION['next_reseptsend'] = 1;
$message = "Hello {$x['username']},
You requested to resend your account password a while ago.
Account Username: {$x['username']}
Account Password: {$x['password']}
We hope you can have a good time earning your money again,
Thanks,
{$config['site_name']}";
mail($x["email"],"Password Retrieval - ".$config["site_name"],$message,"From: mail@".$_SERVER['HTTP_HOST']);
print "<b>Password Sent!</b><br />
We have dispatched your password to your email address.<br />
You can only make another account retrieval again in 15 minutes.<br />";
}
}
?>
<div style="padding-left:25px;">
<form action="recover.php" method="post" name="resend">
<table>
<tr><td class="midtext">Your Email:</td><td><input type="text" name="email" size="25" class="form" autocomplete="off" value="<?=$_POST['email']?>"></td></tr>
<tr><td class="midtext" valign="top">Security Code:</td><td class="midtext"><img src="image.php" onclick="this.src='image.php?newtime=' + (new Date()).getTime();"><br /><span style="font-size:10px;">(Click to reload)</span><br /><input type="text" name="code" size="17" maxlength="" autocomplete="off" class="form"></td></tr>
<tr><td></td><td align="right"><input type="submit" value="Login" name="loginsubmit" class="inputbox"></td></tr>
</table>
</form>
</div>
<? include "footer.php"; ?> |
||
| Ulikar Profil * |
#2 · Zasláno: 10. 9. 2011, 19:39:38
Kde jsi ten kód vzal?
A co máš v těch souborech confing.php, data.php a funciones.php? |
||
| kuba95 Profil |
#3 · Zasláno: 10. 9. 2011, 19:45:06
Ulikar:
config.php: <?php
$dhost = "localhost"; //usually localhost, or ip
$dusername = "*****"; // database user
$dpassword = "*****"; // database pass
$ddatabase = "*****"; // database name
$script_path = "http://*****"; // your script have isntalled, do not include "/" slash at the end
//////////////////////////////////////////////
// //
// //
// Connect to MySQL server //
// Do not change anything bellow //
// //
// //
//////////////////////////////////////////////
//Connect to MySQL server///////////////////////////////////////////////////////////////
////
$con = mysql_connect($dhost, $dusername, $dpassword) or die("Cannot Connect"); ////
mysql_select_db($ddatabase, $con); ////
////
if($_COOKIE["usNick"] and $_COOKIE["usPass"]) ////
{ ////
$q = mysql_query("SELECT * FROM tb_users WHERE username='{$_COOKIE['usNick']}' AND password='{$_COOKIE['usPass']}'") or die(mysql_error()); ////
if(mysql_num_rows($q) == 0) ////
{ ////
$_COOKIE['usNick'] = false; ////
$_COOKIE['usPass'] = false; ////
} else { ////
$loggedin = 1; ////
$r = mysql_fetch_array($q); ////
} ////
} ////
?>data.php: <?php
session_start();
include "config.php";
global $loggedin;
if($_GET['r'])
{
$_SESSION['r'] = $_GET['r'];
}
$user = $_COOKIE['ucNick'];
$sitenamez1 = "SELECT price FROM tb_config WHERE item='Site_Name' and howmany='1'";
$alertpayz1 = "SELECT price FROM tb_config WHERE item='Admin_Alertpay_' and howmany='1'";
$forumz1 = "SELECT price FROM tb_config WHERE item='Forum_URL' and howmany='1'";
$titlez1 = "SELECT price FROM tb_config WHERE item='Site_Title' and howmany='1'";
$payouts1 = "SELECT price FROM tb_config WHERE item='Amount_Payouts' and howmany='1'";
$sitenamez2 = mysql_query($sitenamez1);
$alertpayz2 = mysql_query($alertpayz1);
$forumz2 = mysql_query($forumz1);
$titlez2 = mysql_query($titlez1);
$payoutz2 = mysql_query($payoutz1);
$sitenamez3 = mysql_fetch_array($sitenamez2);
$alertpayz3 = mysql_fetch_array($alertpayz2);
$forumz3 = mysql_fetch_array($forumz2);
$titlez3 = mysql_fetch_array($titlez2);
$payoutz3 = mysql_query($payoutz2);
$config['site_name'] = $sitenamez3["price"];
$config['title'] = $titlez3["price"];
$config["forum"] = $forumz3["price"];
$config["Alertpay"] = $alertpayz3["price"];
$config["payout"] = $payoutz3["price"];
$config['site_path'] = "$script_path";
///////////////////////////////////////////////////////////////////////////////////////////////
// funcion para sanitizar variables
function securedata($mensaje)
{
$mensaje = htmlentities(stripslashes(trim($mensaje)));
$mensaje = str_replace("'"," ",$mensaje);
$mensaje = str_replace(";"," ",$mensaje);
$mensaje = str_replace("$"," ",$mensaje);
return $mensaje;
}
// ip real
function getRealIPe()
{
if( $_SERVER['HTTP_X_FORWARDED_FOR'] != '' )
{
$client_ip =
( !empty($_SERVER['REMOTE_ADDR']) ) ?
$_SERVER['REMOTE_ADDR']
:
( ( !empty($_ENV['REMOTE_ADDR']) ) ?
$_ENV['REMOTE_ADDR']
:
"unknown" );
$entries = split('[, ]', $_SERVER['HTTP_X_FORWARDED_FOR']);
reset($entries);
while (list(, $entry) = each($entries))
{
$entry = trim($entry);
if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $entry, $ip_list) )
{
// http://www.faqs.org/rfcs/rfc1918.html
$private_ip = array(
'/^0\./',
'/^127\.0\.0\.1/',
'/^192\.168\..*/',
'/^172\.((1[6-9])|(2[0-9])|(3[0-1]))\..*/',
'/^10\..*/');
$found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);
if ($client_ip != $found_ip)
{
$client_ip = $found_ip;
break;
}
}
}
}
else
{
$client_ip =
( !empty($_SERVER['REMOTE_ADDR']) ) ?
$_SERVER['REMOTE_ADDR']
:
( ( !empty($_ENV['REMOTE_ADDR']) ) ?
$_ENV['REMOTE_ADDR']
:
"unknown" );
}
return $client_ip;
}
?>funciones.php: <?php |
||
| Davex Profil |
#4 · Zasláno: 11. 9. 2011, 18:34:13
kuba95:
„script mi z nějakého důvodu email nepošle...“ Zobrazí se zpráva, že by e-mail odeslán? Neskončí ve spamu? Hlavička by měla končit odřádkováním: mail($x["email"], "Password Retrieval - " . $config["site_name"], $message, "From: mail@" . $_SERVER['HTTP_HOST'] . PHP_EOL); |
||
| kuba95 Profil |
#5 · Zasláno: 11. 9. 2011, 22:13:10
Davex:
„Zobrazí se zpráva, že by e-mail odeslán? Neskončí ve spamu?“ jo, zpráva o odeslání se v pořádku zobrazí a ve spamu to také není „Hlavička by měla končit odřádkováním:“ upravil jsem to podle toho jak píšeš, ale pořád nic... |
||
| CZechBoY Profil |
#6 · Zasláno: 12. 9. 2011, 08:07:19
zkoušel si to odeslat na jiný email?
|
||
| kuba95 Profil |
#7 · Zasláno: 12. 9. 2011, 16:25:15
díky všem, už mi to funguje... asi to bylo tím doplněním od Davex. Díky
|
||
|
Časová prodleva: 14 let
|
|||
0