Guest User

Untitled

a guest
Jan 21st, 2019
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?php
  2.  
  3. /*Check Box Commands*/
  4. $id=$row_notification['user_id'];
  5.  
  6. if(isset($_POST['Activate'])) {
  7. $checkbox = $_POST['checkbox'];
  8. mysql_select_db($database_connection_ched, $connection_ched);
  9. $id=$row_notification['user_id'];
  10.  
  11. for($i=0;$i<count($checkbox);$i++)
  12. {
  13. $update = "UPDATE tb_user SET status='active' WHERE user_id=$checkbox[$i]";
  14. mysql_query($update,$connection_ched);
  15. }
  16. $result1 = mysql_query($update);
  17.  
  18. if($result1)
  19. {
  20. echo "<script language='javascript'>alert ('The selected item/s was successfully Activated!');</script>";
  21. echo "<meta http-equiv="refresh" content="0;URL=notification.php?">"; }
  22. }
  23. /*End of Checkbox Commands*/
  24. ?>
  25.  
  26. <?php
  27. require("class.phpmailer.php");
  28. include("class.smtp.php");
  29. $mailer = new PHPMailer();
  30. $mailer->IsSMTP();
  31. $mailer->Host = 'ssl://smtp.gmail.com:465';
  32. $mailer->SMTPAuth = TRUE;
  33. $mailer->Username = 'myemail@gmail.com';
  34. $mailer->Password = 'mypassword';
  35. $mailer->From = 'myemail@gmail.com';
  36. $mailer->FromName = 'Admin';
  37. $mailer->Body = 'TEST EMAIL';
  38. $mailer->Subject = 'This is the subject of the email';
  39. $mailer->AddAddress('myrecipient@yahoo.com');
  40. if(!$mailer->Send())
  41. {
  42. echo "Message was not sent<br/ >";
  43. echo "Mailer Error: " . $mailer->ErrorInfo;
  44. }
  45. else
  46. {
  47. echo "Message has been sent";
  48. }
  49. ?>
  50.  
  51. <input title="Activate" name="Activate" type="submit" id="Activate" value="Activate" onclick="return confirm('Are you sure you want to Activate the selected user/s?')"/>
  52. <input title="SendEmail" name="SendEmail" type="submit" id="SendEmail" value="SendEmail" onclick="return confirm('Are you sure you want to send email?')"/>
Add Comment
Please, Sign In to add comment