Jump to content

PHP friend request Notification


shibobo12

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/142797-php-friend-request-notification/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.