Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_cache_limiter();
- session_start();
- //require config and functions files
- require('config.php');
- require('functions.php');
- //check for administrative rights
- if (allow_access(Administrators) != "yes")
- {
- include ('no_access.html');
- exit;
- }
- //make the dbase query selecting only email address
- $sql ="SELECT * FROM `authorize` WHERE `email` <>";
- $result = @mysql_query($sql,$connection) or die(mysql_error());
- echo mysql_error();
- echo "Your Message Has Been Sent to the Following Users:<br><br>";
- while ($sql = mysql_fetch_object($result))
- {
- $e_fn = $sql -> firstname;
- $e_ln = $sql -> lastname;
- $e_addr = $sql -> email;
- $e_user = $sql -> username;
- $subject = $_POST[e_subject];
- $mailheaders = $_POST[e_message];
- mail($e_addr, $subject, $mailheaders, "From: No Reply <$adminemail>\n");
- echo "$e_fn $e_ln<br>";
- }
- ?>
- <html>
- <head>
- <meta http-equiv="refresh" content="5; url=adminpage.php" />
- </head>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement