10. Friend and Block System PHP MySQL Ajax Tutorial Social Network Website Development

Lesson Code: http://www.developphp.com/video/PHP/Friend-Add-Block-System-Ajax-Tutorial
Learn web development logic behind creating Friend systems and user Block systems using PHP, MySQL, JavaScript Ajax, and simple dynamic HTML rendering for your social networking website system.


34 thoughts on “10. Friend and Block System PHP MySQL Ajax Tutorial Social Network Website Development”

  1. Everything i did up to know works. But when i updated my user.php i keep getting the "try again" message when ever i send the friend request. All my files are spelled correctly, all files in right folders. Ive watched the video times and times and just cant figure it out. It seem the java is not picking up the php_parsers/friend_system. Nothing gets inserted in the database tables also thats how i know it not picking the script. Thank Adam first of all and thanks for whoever can help me

  2. If anyone is having errors/getting "please wait…" place the main .js and ajax.js directory into your file and where in ajax.js framework sure you "return x; " if you don't then you'll run into Uncaught TypeError: Cannot set property 'onreadystatechange' of undefined which will not fire off because ajax.js ajaxObj isn't being return. hope this helps — code down below

    function ajaxObj (meth, url){
    var x = new XMLHttpRequest();
    x.open(meth, url, true);
    x.setRequestHeader("Content-type", "application/x-www-form-urlendcoded");
    return x;

  3. Sir why r u using the procedural why not you goto object -oriented php plzz tell me sir i'm totally confused .
    The most of the people are saying that procedural is waste to design social network sites plzz reply mee

  4. I like Adams teaching I watch this social series from the beginning and sometimes I keep repeating on watching to review again and still continuing and will watch till the end of the social series and build mine while looking back again this tutorial. Thank you Mr. Adam you thought me a lot and will continue learning from you. I hope you won't get tired because I want to learn more.

  5. hello Adam, please am workin on a site where members get to creat pages, lik pages, folow pages and members… How cn i keep track of all the pages a member has liked or followed?

  6. Dude, I laughed my ass out in this video hahaha You were soooooo mad, but it was very fun to listen hahah I hope you are doing fine now 🙂

    Ah, once more, thanks for this amazing tutorial! 🙂

  7. i tried to code the index.php missing code, may be it will help a little bit, you can improve and send back us

    for index.php————————————————————————————

    <?php // Script Error Reporting
    ini_set('display_errors', '1');
    // Connect to the MySQL database
    //include "storescripts/connect_to_mysql.php";

    $dynamicList = "";
    $sql ="SELECT * FROM users ORDER BY lastlogin DESC LIMIT 20 ";
    $query = mysqli_query($db_conx, $sql);
    $productCount = mysqli_num_rows($query);
    if ($productCount > 0) {
    while($row = mysqli_fetch_array($query)){
    $id = $row["id"];
    $username = $row["username"];
    $gender = $row["gender"];
    $last_login = strftime("%b %d, %Y", strtotime($row["lastlogin"]));

    $dynamicList .= '
    User: <a href="user.php?u=' . $username . '" > ' . $username . ' </a> <br/>
    Gender: ' . $gender . ' <br/>
    Last Login: ' . $last_login . ' <br/>

    </p> ';

    } else {
    $dynamicList = "NO user has been signed up yet";

    <!DOCTYPE html>
    <meta charset="UTF-8">
    <title>Web Intersect Social Network Tutorials and Demo</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon" >
    <link rel="stylesheet" href="style/style.css" >



    <?php include_once("template_pageTop.php"); ?>
    <?php include_once("template_pageMiddle.php"); ?>
    <?php include_once("template_pageBottom.php"); ?>
    for template_pageMiddle.php

    <div id="pageMiddle">&nbsp;&nbsp;&nbsp;<br/><br/><br/><br/>
    <div> <strong>Temporary users testing the live tutorial system !</strong></div>
    <table width="100%" border="1">
    <p> <?php echo $dynamicList; ?> </p>

  8. Dear Adam!
    I am facing issue with Block Friend – Watched your video 15 times still facing "Please wait …" issue.
    Everything including php_parsers (friend_system and block also) and user.php is updated. If any genius knows solution Please help me in resolving this issue. Thank You!

  9. Adam, tnx for the trorials, but in the friend php in order to send a request one have to go to the user page, can you make turorial on how to send a request with out going to the user page. a list of users and an add friend button next to them.

  10. Adam, thank you for your tutorials, they are by far the best I have found.

    I recently tried to fix the bug where changing the case of a letter in your username allows you to friend or block yourself. I was able to fix this issue by making the mysql database entry "username" case sensitive (latin1_general_cs). I am proud of myself for this fix, since I started learning php about two weeks ago. I am curious if anyone foresees any problems I might have because of this change. Thank you.

  11. Hey good job Adam on the videos. you are an amazing programer. I have one little problem I did everything you did but i keep on getting a "try again later" on the request.

  12. Im having some problems. When i send friend request, block or unfriend a user the action happen but i always get back the php echo and the "Try again later" status msg. When the echo from php is "friend_request_sent" the status msg should be  'OK Friend Request Sent'. But it isnt working and i don`t know how to fix it, can someone help me?

  13. watching… following the whole series…. and CRACKING UP lmao. U are funny as hell!!! Most who watch, as i see in the comments… watch one clip, and have NO understanding of whats going on. I stumbled big time on vid 6… but plugged away till i found my issue (database permissions… wrote it myself without paying attn…)
      love the way you descrie things. Cudo's, man. 

  14. Another great video tutorial Adam, thanks!

    Something I noticed when I was testing adding friends; if you type your user name in the address bar differently than it is in the database (ie, when you create your user name as "Adam" and type in "adam") the programming thinks it's a different user and WILL let you add yourself as a friend. Not sure if anyone else noticed this, but I'm going to do some work to figure out how to make that not happen. If you have any pointers, I'm sure we'd all appreciate them.

    Thanks again! Keep up the good work.

  15. Dude, what you're doing flows far above amazing, and I'm sure all your subscribers realizes the painstaking length you go through to share your wisdom. So please, don't get too discourage Those fools you lose from the repetition you endure from lesson to lesson are the same fools who are afraid of achieving their own greatness. Keep up the stellar work. We love you, man. You are the best. The one stop shop of coding.

  16. I don't know about the annoying part but, I do know you are supplying quality info.  Long live the annoyance.  Looked through the mega list of tutorials you have created and am just simply amazed.  Is there any tutorial in there about restricting data by user?  User1 logins and only reference User1 data, User2 only User2? 
    Again Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *