Private Messageing System |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Web Design & Development Server Side Scripting PHP |
||
![]() |
Private Messageing System |
||
Jan 3 2008, 10:46 PM
Post
#1
|
|
![]() Outrageously Uber Ninja ![]() Group: Community Helper Posts: 1,756 Joined: 11-November 07 From: HouseMaybe? Member No.: 2,689 |
Hi everyone
I have been trying to do a PMS and I have found a tutorial Here but when I go through it I get stuff like this all over the page CODE Inbox.php "; } else { //Get your private message count //Find the percentage that your inbox is full $sql = mysql_query ("SELECT pm_count FROM users WHERE username='$users'"); $row = mysql_fetch_array ($sql); $pm_count = $row['pm_count']; $percent = $pm_count/'50'; $percent = $percent * '100'; ?> CODE Sent.php "; } else { //Get your private message count $sql = mysql_query ("SELECT pm_count FROM users WHERE username='$user'"); $row = mysql_fetch_array ($sql); $pm_count = $row['pm_count']; $percent = $pm_count/'50'; $percent = $percent * '100'; ?> CODE Compose.php $error "; } //There are no errors so far which means the form is completely filled out else { //Are the trying to send a message to a real user or to something they just made up? $user_check = mysql_query("SELECT username FROM users WHERE username='$reciever'"); $user_check = mysql_num_rows($user_check); //The user is real and not made up if this is true if($user_check > '0') { //There might already be a sessioned time variable, if so we need to get it for the flood check $time = $_SESSION['time']; //If there is a time variable already, set it to the varialbe $old_time if($time > '0') { $old_time = $time; } //Here we get the minutes and seconds on the server time using the date function, and set that to the $time variable //Now we find the difference between this time ($time) and the time that the page was submitted ($old_time) $time = date('is'); $difference = $time - $old_time; $_SESSION['time'] = $time; //If the two times have a difference greater or equal to 15, which is 15 seconds, they can submit the message, this is for flood protection if($difference >= '15') { //Get their private message count $sql = mysql_query ("SELECT pm_count FROM users WHERE username='$reciever'"); $row = mysql_fetch_array ($sql); $pm_count = $row['pm_count']; //You cant have more than 50 private messages, if they try sending a message to a user with a full inbox return an error message if(pm_count == '50') { $error = 'The user you are trying to send a message to has 50 private messages, sorry but we cant send your message untill that user deletes some of their messages.'; } else { //And not we stick the message in the database with all the correct information mysql_query("INSERT INTO messages (reciever, sender, subject, message) VALUES('$reciever', '$user', '$subject', '$message')") or die (mysql_error()); } //Let the user know everything went ok. echo " You have successfully sent a private message! "; } //Since they are trying to send messages faster than every 15 seconds, give them an error message else { $error = 'You must wait 15 seconds before sending another private message'; } } //If they mis spelled or, made up a username, then give an error message telling them its wrong. else { $error = 'That username does not exist, please try again. Remember to check your spelling, and don't make stuff up at random.'; } } } //Since we may have set the error variable to something while trying to send the messae, we need another error check if($error != '0') { echo " $error And it just doesn't want to work for me please could someone give me a hand with this ? Sorry Just added some more Thank You In Advanced Crown |
|
|
Jan 10 2008, 07:08 PM
Post
#2
|
|
![]() Newbie ![]() Group: Members Posts: 14 Joined: 10-January 08 Member No.: 6,585 |
is that stuff appearing in your browser? if so, it looks like you've misplaced some quotation marks. can you post you're actual code?
|
|
|
Jan 10 2008, 08:37 PM
Post
#3
|
|
![]() Marvellous Ninja ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderators Posts: 581 Joined: 25-October 07 From: Windsor, UK Member No.: 1,866 |
QUOTE is that stuff appearing in your browser? if so, it looks like you've misplaced some quotation marks. can you post you're actual code? He said hes following a tutorial so you can see the code here http://www.egmods.com/Main/Tutorials/php/intermediate/pms/ instead of waiting for him to post it. Also if that pm system is no good there is a different tutorial for one here http://www.phpfreaks.com/tutorials/148/0.php |
|
|
Jan 12 2008, 05:04 PM
Post
#4
|
|
![]() Outrageously Uber Ninja ![]() Group: Community Helper Posts: 1,756 Joined: 11-November 07 From: HouseMaybe? Member No.: 2,689 |
|
|
|
Jan 20 2008, 06:44 PM
Post
#5
|
|
![]() Member ![]() ![]() Group: Members Posts: 47 Joined: 28-November 07 Member No.: 3,606 |
Its PHP but there are some "//" ignored lines and it seems to be compressed or dunno what, you should to separate the code or some PHP code lines wont run and will return errors.
|
|
|
Feb 3 2008, 09:12 PM
Post
#6
|
|
|
Newbie ![]() Group: Members Posts: 1 Joined: 3-February 08 Member No.: 8,868 |
Did You Add
CODE <php --Code Here-- ?>
|
|
|
Feb 4 2008, 10:35 AM
Post
#7
|
|
![]() Outrageously Uber Ninja ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderators Posts: 1,562 Joined: 19-September 07 From: Rochester, NY Member No.: 86 |
That coding system you saw at that link isn't that great...many had reported before that it did not work well for them. I really don't have time to check your code but I would look for calling of phrases and files.
GoldenLegacy, you're missing a question mark in your code CODE <?php I WILL RULE THE WORLD ?>
|
|
|
Mar 4 2008, 03:54 AM
Post
#8
|
|
![]() Super Duper Ninja ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 423 Joined: 24-February 08 Member No.: 11,718 |
i am using the same tutorial and it is finally working for me.
|
|
|
Mar 8 2008, 02:34 PM
Post
#9
|
|
![]() Cool guy ![]() ![]() ![]() Group: Moderators Posts: 193 Joined: 27-May 07 From: N.Ireland Member No.: 10 |
@ Crown:
Please tell me you included <?php and ?> -___- |
|
|
Mar 8 2008, 02:49 PM
Post
#10
|
|
![]() Outrageously Uber Ninja ![]() Group: Community Helper Posts: 1,756 Joined: 11-November 07 From: HouseMaybe? Member No.: 2,689 |
|
|
|
Mar 9 2008, 01:02 AM
Post
#11
|
|
![]() Super Duper Ninja ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 423 Joined: 24-February 08 Member No.: 11,718 |
ill be posting a tutorial on it with it integrating my users system tutorial... whenever i get the time though..
|
|
|
![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 25th May 2013 - 10:29 AM |