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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.