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 …

source


36 responses to “10. Friend and Block System PHP MySQL Ajax Tutorial Social Network Website Development”

  1. 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
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    ?>
    <?php
    // Connect to the MySQL database
    //include "storescripts/connect_to_mysql.php";
    include_once("php_includes/db_conx.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 .= '
    <p>
    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";
    }
    mysqli_close($db_conx);
    ?>

    <!DOCTYPE html>
    <html>
    <head>
    <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" >

    </head>

    <body>

    <?php include_once("template_pageTop.php"); ?>
    <?php include_once("template_pageMiddle.php"); ?>
    <?php include_once("template_pageBottom.php"); ?>
    </body>
    </html>
    —————————————————————————————————————————–
    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">
    <tr>
    <td>
    <p> <?php echo $dynamicList; ?> </p>
    </td>
    </tr>
    </table>
    </div>
    —————————————————————————————————————————–

  2. 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!

  3. 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.

  4. 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.

  5. 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?

  6. 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. 

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

  8. 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.

  9. 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

  10. Yes I had the same issue. In the root folder, where your index.php, user.php, forgotpass.php lives, create a new subfolder called php_parsers and put the block_system.php and friend_system.php files in there. There is no issue with his code, just put those two files in there. At 12:54 notice his address bar at the top, and you can see the file directories there.

Leave a Reply