Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. 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
  2. $emailCount = mysql_num_rows($sql); // count the output amount
  3. if ($emailCount > 0) {
  4. while($row = mysql_fetch_array($sql)){
  5. $id = $row['users_id'];
  6. $email = $row["email"];
  7. $fname = $row["first_name"];
  8. $lname = $row["last_name"];
  9. $message = "
  10. We Have News and Updates for You!
  11. News About $prod_title
  12. Just click on the link below to visit our site
  13. http://globalinc.com/
  14.  
  15. thank you very much $fname $lname
  16.  
  17. From: global corporation
  18. ||||||||||||||||||||||||||||||||||||||||||||||||||||
  19. ||This is an automated email. Please do not reply.||
  20. ||||||||||||||||||||||||||||||||||||||||||||||||||||
  21. ";
  22. echo mail($email, " Global SInc. News and Updates",$message,"From: DoNotReply@globalinc.com");;
  23. }
  24. }
  25. echo "<script>
  26. alert('Successfully added');
  27. window.location='newsstaff.php';
  28. </script>";
  29. }
  30. }
  31. else
  32. {
  33. echo "<div id='error'><script>
  34. alert('Please fill in all fields!!');
  35. </script></div>";
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement