I've always loved football in general, and the shirts/jerseys in particular. An amazing freekick or a spectacular pass is hard to achieve, but creating a memorable shirt is way harder. Here is a glimpse of the classics according to my own taste and opinion.
Visit: https://www.filipjonasson.com/elephpant/index.php
Code review written by Thomas Danielsson.
index.php:21-25
- You should use an arrow functionconst refreshPage = () => {}
instead offunction refreashPage(){}
. As it is a little more modern and simplified way of writing functionsindex.php:22-24
- There is no use forif(true){}
in your function as it always will be true, so here you can write your refresh page code without the 'if'.shirtInfo.php:17, 25
- The$title
and$source
doesnt need quotation marks to function.arrays.php:23, 36-37, 47, 80, 126
- To break the lines in the text you use the HTML tag 'br', in the php arrays. HTML code should be avoided in php codeshirtInfo.php:8
- There is no validation for the '$_GET
' so the user can use it to send harmful code, such as crashing the page when putting anything above '9' after?shirtIndex=
in the url. You could add a function that makes sure the$_GET["shirtIndex"]
is a number and limit the integer it returns to the values 0-9
Tested by the following people:
- Vali Al Osachi
- Emma Hedlund