shibobo12 Posted January 28, 2009 Share Posted January 28, 2009 Hi folks Looking for some help regarding the below, i need to send a notification whereby if John wants to be Peter's friend, John will click on Peter's name hyperlink "Make Friend", then a notification will be sent to peter and will appear on Peter,s profile page, then once Peter has accepted friendship, these two people can then become friends, then ofcause the "friends" table will be updated, how do I write a PHP code for this, so far I have got: <?php session_start(); $a = $_SESSION["gatekeeper"]; $conn = mysql_connect("localhost", "PeterJones", "PeterJones"); mysql_select_db("JonesPeter"); if ( !isset ($_SESSION["gatekeeper"])) { echo "You're not logged in. Go away!"; } else { $result=mysql_query("SELECT * FROM users WHERE username = '$a'"); while($row=mysql_fetch_array($result)) { echo "You are logged in as!"; echo " $row[username] <br />"; // How do I make the currently user's online friends to display like this????? Please help me on this one as well!!! echo " Online friends <br> <br />"; //John, Josh, Joseph etc ???? Please help me on this one as well!!!! echo " Search for your Friends <br> <br />"; } } ?> <form method="post" action="search.php" <label for="username">Name</label> <input type="text" name="username" /> <input type="submit" value="Search" /> </form> </body> <div> <a href="logout.php"> Logout</a> Regards Shibobo12 Quote Link to comment https://forums.phpfreaks.com/topic/142797-php-friend-request-notification/ Share on other sites More sharing options...
satishgadhave Posted January 29, 2009 Share Posted January 29, 2009 can you post your 'friends' table structure and how you are using its fields ? Quote Link to comment https://forums.phpfreaks.com/topic/142797-php-friend-request-notification/#findComment-749388 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.