Mass PM


Here is a Mass PM system i made and should work for Daniel's PM system when he gets around to coding it!

PHP Code
  1. <?
  2. session_start();
  3. include('config.php');
  4. if($logged[username] && $logged[userlevel] == 6) { // Verifys Admin
  5.  
  6. if(!$_POST[submit]) {
  7. echo('<form method=\"POST\">
  8. <p><input type=\"text\" name=\"title\" size=\"20\"><br>
  9. <br>
  10. <textarea rows=\"2\" name=\"message\" cols=\"20\"></textarea></p>
  11. <p><input type=\"submit\" value=\"Submit\" name=\"submit\"></p>
  12. </form>');
  13. } else {
  14. $title = $_POST['title'];
  15. $message = $_POST['message'];
  16.  
  17. $getmembers = mysql_query("SELECT * FROM members");
  18. while($r = mysql_fetch_array($getmembers)){
  19.  
  20. $spm = mysql_query("INSERT INTO `pmessages` ( `title` , `message` , `to` , `from` ) VALUES ('$title','$content','$r[username]','$logged[username]'") or die();
  21.  
  22. echo("Sent to $r[id] $r[username]<br>");// Shows who it has been sent to.
  23. }
  24. }
  25. ?>


This has not been tested yet.

Adam
Overload's Avatar
Author:
Views:
2,647
Rating:
Posted on Wednesday 20th June 2007 at 12:08 PM
fryser
fryser's Avatar
Heh? remplace "sessionstart();" with "session_start();"
lol
Posted on Friday 16th March 2007 at 04:12 PM
Joshua
Joshua's Avatar
Alright.
Overload, this is just what I was trying to say.
When you are posting a tutorial, Explain it more, or I will not accept it, tutorials are for people who look towards it, yes, I know that Copy and Pasters are people too, but they do not learn the value of coding PHP. And I don't care if you say I was "annoying" you because I said you did this for points, if you have of wanted to get the credit for actually making this, I would have better explained it and tested it. I don't care if you didn't have the other user system, try not and be lazy next time and actually do it yourself.

Josh
Posted on Thursday 15th March 2007 at 06:28 PM
ShadowMage
ShadowMage's Avatar
I shall take a look at both of them and compare them side by side when i get home this afternoon.
Posted on Thursday 15th March 2007 at 06:12 PM
Overload
Overload's Avatar
Jeez -.- now im ripping i take it?
Posted on Thursday 15th March 2007 at 04:55 PM
Dean
Dean's Avatar
looks very similar to the one posted on techtuts :|
Posted on Thursday 15th March 2007 at 12:50 PM
Overload
Overload's Avatar
I did not add it for points ... thats just sad i honestly could not care about points ... i added it to help people, copy & pasters our attual people who want to learn PHP. I can't test this as i dont have the specific usersystem for this ... My friend needed this script so he'll test it for me ... It should 100% work .. and you kinda annoyed me trying to say i only posted this for points!!!

Adam
Posted on Wednesday 14th March 2007 at 11:12 PM
Joshua
Joshua's Avatar
You did not correctly explain the MASS PM, and the "This has not been tested yet." tells us that you are just in the tutorial adding for the points, not to help people, if you were to have checked it, like everyone else does with their tutorial, you might get a bit more credit, but yes, i would like to know a bit more explinations if I were new to PHP and looking into this for the first time.

Josh~