File: /home/panama/public_html_old/reset.php
<?
include("include/config.php");
$db_sel = new database();
$pageid=7;
$db_sel->where("pageid=".$pageid);
$db_sel->selectstmt("cmspagemaster");
$pagetitle = $db_sel->f_pagetitle;
$pagemeta = $db_sel->f_pagemeta;
$pagemetadesc = $db_sel->f_pagemetadesc;
//$str_len=strlen($db_sel->f_pagedesc);
//if($str_len>1100)
//$description = substr($db_sel->f_pagedesc,0,1100)."...";
//else
$description = $db_sel->f_pagedesc;
?>
<!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=utf-8" />
<meta name="description" content="<?=$pagemetadesc?>" />
<meta name="keywords" content="<?=$pagemeta?>"/>
<title><?=SITE_TITLE."- Services - ".$pagetitle?></title>
<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="styles.css"/>
<!-- Javascript -->
<!--[if IE 6]><script src="js/ie6.js"></script><![endif]-->
<link rel="stylesheet" href="css/dropdownmenu.css" type="text/css" />
<script type="text/javascript" src="js/dropdownmenu.js"></script>
<? include('includescript.php')?>
</head>
<body>
<? include("header.php") ?>
<div id="contentwrapper">
<div class="contentcontainer">
<div class="maincontainer">
<div class="servicesbannerwrapper"><img src="images/banner_services.jpg" width="958" height="178" alt=""/></div>
</div>
<div class="maincontainer">
<div class="servicetextwrapper">
<div class="title">
<div class="breadcrumbs">
<ul>
<li class="first"><span class="titleicons"><img src="images/icon_services.png" width="40" height="42" alt=""/></span> Services</li>
<li><?=$pagetitle?></li>
</ul>
</div>
</div>
<div >
<font size="2">Please Fill up Your Email, Reset
Your Password.</font>
<form action="reset.php" method="POST" onsubmit="return checkInput(this);">
<script type="text/javascript" language="javascript">
function checkInput(resendform)
{
if(signupform.txtEmail.value=="")
{
alert("Email Can not be empty!");
signupform.txtEmail.focus();
return false;
}
var myCheck=/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if(!myCheck.test(signupform.txtEmail.value))
{
alert("Invalid Email!!!");
signupform.txtEmail.focus();
return false;
}
//alert("HaHa");
return true;
}
</script>
<table border="0" width="100%" id="table1">
<tr>
<td align="right" width="26%">Email:</td>
<td width="72%"><input type="text" name="txtEmail" size="52">*</td>
</tr>
<tr>
<td align="right" colspan="2">
<p align="center" style="text-align: center">
<input type="submit" value="Reset" name="submit" id="submit"> <input type="reset" value="Clear" name="reset" id="clear"></td>
</tr>
</table>
<?php
if (@$_GET["reset"] <> "")
{
$reset=@$_GET["reset"];
if($reset=="true")
{
echo "Your Password has been reset. Please <a href='onlinevisa.php'>Sign in</a>";
}
else
{
}
}
?>
<p> </p>
</form>
</div>
</div>
<div class="servicesphotowrapper">
<div class="servicesphotocontainer">
<? include("right.php");?>
</div>
</div>
</div>
</div>
<? include('footer.php') ?>
</div>
<?php require_once ("include/ewconfig.php") ?>
<?php require_once ("include/db.php") ?>
<?php
require("include/class.phpmailer.php");
if (@$_POST["submit"] <> "")
{
$strEmail = @$_POST["txtEmail"];
$conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
MySQL_query("SET NAMES 'utf8'");
/*Check Email*/
$StrCheck="select * from visa_user Where username='".$strEmail."'";
$query = phpmkr_query($StrCheck, $conn) or die("<font color='#FF0000'>ERROR: Failed to execute query at line " . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL: ' . $sSql."</font>");
$rs = phpmkr_fetch_array($query);
$query = phpmkr_query($StrCheck, $conn) or die("<font color='#FF0000'>ERROR: Failed to execute query at line " . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL: ' . $sSql."</font>");
if (phpmkr_num_rows($query) > 0)
{
$userid=$rs["userid"];
$strFirstName=$rs["firstname"];
$strLastName=$rs["lastname"];
$strEmail=$rs["username"];
/*Send Email*/
$mail = new phpmailer();
$uniq_id = md5(uniqid(time()));
//$mail->SetLanguage('en', "language/");
$mail->IsSMTP();
$mail->IsHTML();
$mail->From = FROM_EMAIL;
$mail->FromName = FROM_NAME;
$mail->Host = EW_SMTPSERVER;
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = EW_SMTPSERVER_USERNAME; // SMTP username
$mail->Password = EW_SMTPSERVER_PASSWORD; // SMTP password
$mail->Subject="Panama Visa Service";
// HTML body
$body = "Hello <font size=\"4\">". $strFirstName ." ". $strLastName ."</font>, <p>";
$body .= "<i>Your</i> Password has been reset.<p>";
$body .= "Your New Password is <font size=\"4\">".base64_decode($rs["password"])."</font>.<br>";
$body .= "Please do not reply this Email.<br>";
$body .= "Sincerely, <br>";
$body .= "Panama Visa Service";
// Plain text body (for mail clients that cannot read HTML)
/*
$text_body = "Hello Eric Wang, \n\n";
$text_body .= "Your personal photograph to this message.\n\n";
$text_body .= "Sincerely, \n";
$text_body .= "phpmailer List manager";
*/
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->AddAddress($strEmail);
//$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
}
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
/*Relocate Page*/
$url="reset.php?reset=true";
header("Location: $url");
}
else
{
echo "<script language=javascript>alert('Invalid Email!!!');</script>";
}
}
else
{
}
?>
</body>
</html>