Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*Check Box Commands*/
- $id=$row_notification['user_id'];
- if(isset($_POST['Activate'])) {
- $checkbox = $_POST['checkbox'];
- mysql_select_db($database_connection_ched, $connection_ched);
- $id=$row_notification['user_id'];
- for($i=0;$i<count($checkbox);$i++)
- {
- $update = "UPDATE tb_user SET status='active' WHERE user_id=$checkbox[$i]";
- mysql_query($update,$connection_ched);
- }
- $result1 = mysql_query($update);
- if($result1)
- {
- echo "<script language='javascript'>alert ('The selected item/s was successfully Activated!');</script>";
- echo "<meta http-equiv="refresh" content="0;URL=notification.php?">"; }
- }
- /*End of Checkbox Commands*/
- ?>
- <?php
- require("class.phpmailer.php");
- include("class.smtp.php");
- $mailer = new PHPMailer();
- $mailer->IsSMTP();
- $mailer->Host = 'ssl://smtp.gmail.com:465';
- $mailer->SMTPAuth = TRUE;
- $mailer->Username = 'myemail@gmail.com';
- $mailer->Password = 'mypassword';
- $mailer->From = 'myemail@gmail.com';
- $mailer->FromName = 'Admin';
- $mailer->Body = 'TEST EMAIL';
- $mailer->Subject = 'This is the subject of the email';
- $mailer->AddAddress('myrecipient@yahoo.com');
- if(!$mailer->Send())
- {
- echo "Message was not sent<br/ >";
- echo "Mailer Error: " . $mailer->ErrorInfo;
- }
- else
- {
- echo "Message has been sent";
- }
- ?>
- <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?')"/>
- <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