echo "<div id='new'>{$afterSubmit}</div>"; } ?> <div id='col1' class='col'> <h3>Friend Requests</h3> <?php displayFriendReq($fr); ?> </div> <div id='col2' class='col'> <h3>Friends</h3> <?php displayFriends($fr); ?> </div> <div id='col3' class='col'> <h3>All users</h3> <?php displayNonFriends($fr); ?> </div> </body> </html>
"> <input type="text" id="search_tbox" name="search_tbox" placeholder="Search for new Friends.. "/> <input type="submit" name="search_button" id="search_button" value="Search"/> <div class="friends_table"> <table> <tr><td> Your Friends </td> <td> Online</td></tr> <?php include 'conn/db_conn.php'; include 'func/quer.php'; include 'func/otherFunctions.php'; $link = connectDatabase(); $user = $_COOKIE['logged_in_user']; $friends = getFriends($user, $link); displayFriends($friends, $link); if (isset($_POST['search_button'])) { if (isset($_POST['search_tbox'])) { $text = $_POST['search_tbox']; $searchedFriends = searchFriend($text, $link); if (FALSE == $searchedFriends) { echo "<script type='text/javascript'>alert('No username found with such name');</script>"; } else { $temp = mysqli_fetch_assoc($searchedFriends); $_SESSION["username"] = $temp; header('Location: add_friend.php'); } } else { echo "<script type='text/javascript'>alert('Search fields are empty.');</script>"; } }