Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sql = mysql_query("SELECT * FROM users where confirmed='1'ORDER BY users_id DESC");//database filter DESC means from bottom to top, since you always adding a product is important to show it at a first line
- $emailCount = mysql_num_rows($sql); // count the output amount
- if ($emailCount > 0) {
- while($row = mysql_fetch_array($sql)){
- $id = $row['users_id'];
- $email = $row["email"];
- $fname = $row["first_name"];
- $lname = $row["last_name"];
- $message = "
- We Have News and Updates for You!
- News About $prod_title
- Just click on the link below to visit our site
- http://globalinc.com/
- thank you very much $fname $lname
- From: global corporation
- ||||||||||||||||||||||||||||||||||||||||||||||||||||
- ||This is an automated email. Please do not reply.||
- ||||||||||||||||||||||||||||||||||||||||||||||||||||
- ";
- echo mail($email, " Global SInc. News and Updates",$message,"From: DoNotReply@globalinc.com");;
- }
- }
- echo "<script>
- alert('Successfully added');
- window.location='newsstaff.php';
- </script>";
- }
- }
- else
- {
- echo "<div id='error'><script>
- alert('Please fill in all fields!!');
- </script></div>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement