Welcome Guest [Log In] [Register]
Add Reply
Question?; Friends
Topic Started: Jul 24 2008, 03:01 PM (422 Views)
Admin
Administrator
I was t5hinking something like this on the user page


Code:
 


$getfriends = mysql_query( "SELECT * FROM `friends` WHERE `username` = '$session->username'" );
$friends = mysql_fetch_array($getfriends);


{
echo "<p class='maintext'>$friends[username] is already been added to your friendlist.</p>";
}
else
{
echo "<p class='maintext'><a href='friends.php?page=2&user=$req_user_info[username]'>Add as Friend</a></p>";
}

Offline Profile Quote Post Goto Top
 
scottjcampbell
Member Avatar

NOTE: This is not in reply to Admin

I get this error:
Quote:
 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at directory\friendrequest.php:11) in directory\session.php on line 46

So i move the include of the session.php to the top as i have read about this somewhere (can't remember) that it may cause problems and it should go at the very top.

Thanks, SCOTT CAMPBELL
Edited by scottjcampbell, Jul 24 2008, 06:51 PM.
Offline Profile Quote Post Goto Top
 
feartec

Yes admin you can do that, but if someone know how the link works, he can just type in his browser:
http://yourwebsite.com/friends.php?page=2&user=feartec

and he can add you again, you must secure the friendrequest.php

and why you use the else statement ?
Edited by feartec, Jul 24 2008, 07:59 PM.
Offline Profile Quote Post Goto Top
 
Admin
Administrator
I guess your right. Ill post new friends script... :)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Friends System · Next Topic »
Add Reply