This commit is contained in:
Logan McInnis
2019-12-02 18:47:20 -08:00
parent 0f7bf31a62
commit 8466d68a15
3 changed files with 36 additions and 15 deletions

View File

@@ -9,6 +9,41 @@ body {
<h2><font color="white">Heres Your Stupid Fucking Friends</h2> <h2><font color="white">Heres Your Stupid Fucking Friends</h2>
<?php
$servername = "localhost";
$username = "web";
$password = "Password456";
$dbname = "computer";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT friend FROM friendlist WHERE username = 'user1' and confirm = false";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0)
{
// output data of each row
while($row = mysqli_fetch_assoc($result))
{
echo "friends: " . $row["friend"]. ;
echo "<button type='button' onclick='window.location.href = 'acceptFriend.php''>Accept Friend Request</button>";
echo "<br>";
}
}
else
{
echo "0 results";
}
?>
</body> </body>
</html> </html>

View File

@@ -14,7 +14,7 @@ body {
<button type="button" onclick="window.location.href = 'search.php'">Search</button> <button type="button" onclick="window.location.href = 'search.php'">Search</button>
<button type="button" onclick="window.location.href = 'sendMessage.php'">Message Someone</button> <button type="button" onclick="window.location.href = 'sendMessage.php'">Message Someone</button>
<button type="button" onclick="window.location.href = 'findFriend.html'">Find a New Friend</button> <button type="button" onclick="window.location.href = 'findFriend.html'">Find a New Friend</button>
<button type="button" onclick="window.location.href = 'pendingFriend.html'">Check Pending Friends</button> <button type="button" onclick="window.location.href = 'pendingFriend.php'">Check Pending Friends</button>
</body> </body>

View File

@@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<style>
body {
background-color: #3B5998;
}
</style>
<h2><font color="white">Heres Your Stupid Pending Friends</h2>
</body>
</html>