GFG Website
GFG Website

GFG Website

 
A sample of the website is present here


This is the Home page of the website
notion image

This is the login page of the user
notion image
<?php session_start(); include("include/connection.php"); if ($_SERVER["REQUEST_METHOD"] == "POST") { $teamname = $_POST["teamname"]; $leadername = $_POST["leadername"]; $event = $_POST["event"]; $score = 0; $search_query = "SELECT teamname FROM leaderboard WHERE teamname LIKE '$teamname'"; if ($search_query == null) { echo "<script> alert('User already exists'); </script>"; } else { $sql_query = "INSERT INTO `leaderboard` (`teamname`, `leadername`, `event`, `score`) VALUES ('$teamname', '$leadername', '$event', '$score')"; $result = mysqli_query($connect, $sql_query); $_SESSION['teamname'] = $teamname; // setting the session for the user echo " <script> window.location='./sample.php'; </script> "; } } ?>

This is the leader board section
notion image
$result = mysqli_query($connect, "SELECT * FROM leaderboard ORDER BY score DESC"); $data = mysqli_fetch_all($result); /* Fetch Rows from the SQL query */ if (mysqli_num_rows($result)) { $wiki_ranking = 1; $com_ranking = 1; $fm_ranking = 1; $bw_ranking = 1; $wi_ranking = 1; foreach ($data as $row) { if ($row[3] == "Wikispeedia") { if ($wiki_ranking == 1) { echo " <br> <br> <h1 style='text-align:center;'> Wikispeedia </h1> <div class='ranking-table-header-row'> <div class='ranking-table-header-data h6'>Rank</div> <div class='ranking-table-header-data h6'>Team Name</div> <div class='ranking-table-header-data h6'>Score</div> </div> "; } database($wiki_ranking++, $row); } }