FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Tutorials / PM / Points





DanielXP
I have a tutorial system where users can post a tutorial and then an admin has to accept it before it will go onto the site but i want it to send a PM and 5 points to the user. i have try this but failed. Sad

This is the code for the tutorial_admin.php
http://frihost.pastebin.com/744742

Below is the code to send a PM
Code:
   $title = "Your tutorial has been accepted!";
   $content = "You tutorial has been accpeted and is now being displayed on the site. You earned 5 points for this!";
   $getusers = mysql_query("SELECT * FROM users");
   $sendpm = mysql_query("INSERT INTO `pmessages` ( `title` , `message` , `touser` , `from` , `date` ) VALUES ('$title','$content','THE USER TO SEND TO','Tutorials (no reply)','NOW()')") or die("Oh great, you broke it!");


The 'THE USER TO SEND TO' has to be replace to the user who posted the tutorial

This is the code to add the points
Code:
   $addpoints = $add['points'] + 5;
   $update2 = mysql_query("UPDATE users SET points = '".$addpoints."' WHERE username = '"THE USER TO SEND TO"'") or die(mysql_error());


Again it needs the user to send to

If any one can try this please help i tryed for over an hour!



mathiaus wrote:

Please do not post long pieces of code. Use Pastebin instead!



DanielXP wrote:

Sorry Mathiaus!
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.