Hi there, this is my NBA PHP website project
Below you will find more information about the website
Enjoy 👀
So, why NBA?
- I love basketball
- So many great players and so much excitement around the league 🏀
Click on one of the options:
- A simple PHP calculation to find out each team's win percentage
//Calculating team win percentage
$total_games = $team['win'] + $team['loss'];
$percent = $team['win'] / $total_games;
$percent_friendly = number_format( $percent * 100, 1 ) . '%';
echo $percent_friendly;
👇
- Setting up the directory where images will be saved
-
// This is the directory where images will be saved $target = "../images/"; $target = $target . basename( $_FILES['image']['name']);
-
- Next, we want to add the image to the database
-
// Add the image to the database $query = "INSERT INTO categories (image) VALUES ('$image')"; // execute query mysqli_query($db, $sql); if (move_uploaded_file($_FILES['image']['tmp_name'], $target)) { $msg = "Image uploaded successfully"; }else{ $msg = "Failed to upload image"; } } $result = mysqli_query($db, "SELECT * FROM images");
-
- Finally we want to display it on the page
-
// Displaying the image <form action="add_team.php" method="post" enctype="multipart/form-data" id="add_category_form"> <input type="file" name="image" id="image" style="padding-top:20px"> <input id="add_category_button" type="submit" value="Add"> </form>
-
Adding new player and editing existing player
- Is that all?
- Of course not, users can also add or delete a team and view the current standings!
By:
Renzo W |
---|
github.com/renwid |
- With
- and the help google
- MIT license
- Copyright 2019 © NBA.