if (count($_POST) > 0) { $arr = $_POST; $arr['add_date'] = date("Y-m-d H:i:s"); $lastID1 = $dbObj->insert_data(TABLE_COMMENT, $arr); /* mail for new comment*/ if ($_SESSION['session_admin_userid'] == '') { if ($lastID1) { $_SESSION['msg'] = '<span style=" color:green;font-size:13px;">Your comment is successfully posted. Will display after approval.</span>'; } $user_name = 'jwasser.com'; //site url $mail = new PHPMailer(); $mail->From = "*****@*****.**"; $mail->FromName = $user_name; $mail->AddReplyTo($_POST['email']); $mail->AddAddress("*****@*****.**"); $mail->Subject = "Comment Posted On Post"; $mail->IsHTML(true); $mail->Body = "<b><font style='font-size:14px;'>Below comment posted on post for approvel</font></b><br><br>\n\t\t <br>" . $arr['comment'] . "<br>"; $mail->send(); //if(!$mail->send()){echo "Not Send";die;}else{echo "Mail Send";die;} } $sqlSel_com1 = "SELECT * FROM " . TABLE_COMMENT . " where post_id=" . $arr['post_id']; $rsResult_com1 = $dbObj->fun_db_query($sqlSel_com1); $total_comment = $dbObj->fun_db_get_num_rows($rsResult_com1); $arr['total_comment'] = $total_comment; $lastID = $dbObj->update_data(TABLE_POST, 'id', $arr, md5($arr['post_id'])); if ($lastID) { redirectURL("show-post.php?id=" . $arr['post_id']); } }
$arr = $_POST; $existemail = $dbObj->fun_check_email_admin_existance1($arr['email']); if ($existemail) { function getRandomString($length = 6) { $validCharacters = "abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ123456789"; $validCharNumber = strlen($validCharacters); $result = ""; for ($i = 0; $i < $length; $i++) { $index = mt_rand(0, $validCharNumber - 1); $result .= $validCharacters[$index]; } return $result; } $arr['reset_key'] = getRandomString(); $lastID = $dbObj->update_data(TABLE_USERS, 'email', $arr, md5($_POST['email'])); $mail = new PHPMailer(); $mail->From = "*****@*****.**"; $mail->AddAddress($_POST['email']); $mail->Subject = "To reset password"; $mail->IsHTML(true); $mail->Body = "<b><font size='+2' color='red'>Reset Password</font></b><br><br>\n\t\t <br>Click the link below to reset your password<br>\n\t\t http://" . $_SERVER['HTTP_HOST'] . "/94/jwasser/forgot.php?key=" . $arr['reset_key'] . "<br><br>"; //echo $mail->Body ;die; if (!$mail->Send()) { $_SESSION['msg'] = 'Mail was not sent.'; redirectURL(SITE_ADMIN_URL . "profile-login.php"); } else { $_SESSION['msg'] = "Check your email INBOX to reset your password"; redirectURL(SITE_ADMIN_URL . "profile-login.php"); } } else {
<?php require_once "includes/application-top.php"; $objAdmin = new Admins(); $objAdmin->fun_authenticate_admin(); $dbObj = new DB(); $dbObj->fun_db_connect(); //print_r($_POST); if (count($_POST) > 0) { $sql_pwd = "SELECT * FROM " . TABLE_USERS . " where password='******'o_password']) . "' and id=" . $_POST['user_id']; $rsResult_pwd = $dbObj->fun_db_query($sql_pwd); $total = $dbObj->fun_db_get_num_rows($rsResult_pwd); if ($total) { if (@$_POST['n_password'] == @$_POST['c_password']) { $arr['password'] = md5($_POST['n_password']); $lastID = $dbObj->update_data(TABLE_USERS, 'id', $arr, md5($_POST['user_id'])); $_SESSION['msg'] = '<span style=" color:green;font-size:13px;">Password changed</span>'; redirectURL(SITE_ADMIN_URL . "logout.php"); } else { $_SESSION['msg'] = "New password and Comform password are not matching"; redirectURL(SITE_ADMIN_URL . "reset-password.php"); } } else { $_SESSION['msg'] = "old password incorrect"; redirectURL(SITE_ADMIN_URL . "reset-password.php"); } }
<?php require_once "includes/application-top.php"; $dbObj = new DB(); $dbObj->fun_db_connect(); $arr['status'] = $_REQUEST['status']; $arr['id'] = $_REQUEST['id']; $arr['approved_by'] = $_REQUEST['approved_by']; $lastID = $dbObj->update_data(TABLE_COMMENT, 'id', $arr, md5($_REQUEST['id'])); ?>