Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/exercises/projekt/

changeowned.php
classes/
createcard.php
database.php
forgot.php
incl/
index.php
leaderboard.php
lineup.php
login.php
logout.php
newpass.php
otherlineup.php
playerinfo.php
projekt.zip
skapatabeller.php
verify.php

playerinfo.php

76 lines UTF-8 Windows (CRLF)
<?php
$title 
"Spelarinfo";
$pageId "playerinfo";
$pageStyle '
figure { 
 border-radius: 10px;
 border-color:#333;
 box-shadow: 10px 10px 5px #888;
}
.stats{
    border-radius: 10px;
    display: grid;
    grid-template-columns: auto auto;
    border-color:#333;
    text-align: center;
   }
   .stats p{
    display: inline-block;
    background-color: lightgreen;
    margin: 10px  100px;
    text-align: center;
 }
    '
;
include(
"incl/default.php");
include(
"incl/header.php");
?> 
<?php
$playerid 
htmlspecialchars($_GET["player"], ENT_QUOTES,'UTF-8');
if (
is_numeric($playerid != true)) {
    die(
"fel uppgifter");
};
try {
    
$sql "SELECT id, name, age, nation, position, rating, pace, shooting, passing, dribbling, defending, physical FROM players WHERE id= $playerid";
    
$stmt $dbconn->prepare($sql);
    
$data = array();
    
$stmt->execute($data);
    while (
$res $stmt->fetch(PDO::FETCH_ASSOC)) {
        echo 
"<div class ='player'>";
        echo 
"<div class='info'>";
        echo 
"<p > Namn: ";
        echo 
htmlentities($res['name']);
        echo 
"</p>  <p > Ålder: ";
        echo 
htmlentities($res['age']);
        echo 
"</p>  <p > Land: ";
        echo 
htmlentities($res['nation']);
        echo 
"</p>  <p > Position: ";
        echo 
htmlentities($res['position']);
        echo 
"</p>  <p id='rating'> Rating: ";
        echo 
htmlentities($res['rating']);
        echo 
"</p>";
        echo 
"</div>";
        echo 
"<div class='stats'>";
        echo 
"<p> Snabb: ";
        echo 
htmlentities($res['pace']);
        echo 
"</p>  <p> Skott: ";
        echo 
htmlentities($res['shooting']);
        echo 
"</p>  <p> Passning: ";
        echo 
htmlentities($res['passing']);
        echo 
"</p>  <p> Dribbling: ";
        echo 
htmlentities($res['dribbling']);
        echo 
"</p>  <p> Försvar: ";
        echo 
htmlentities($res['defending']);
        echo 
"</p>  <p> Fysik: ";
        echo 
htmlentities($res['physical']);
        echo 
"</div>";
        echo 
"</div>";
    }
} catch (
PDOException $e) {
    echo 
$sql "<br />" $e->getMessage();
}

$dbconn null;


?>
<?php 
include("incl/footer.php"?>