Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/projects/

bacon-egg-pizza.php
cquiz.php
create-account.php
create-account111.php
create-quiz.php
create-quiz2.php
createaccount.php
delete-quiz.php
drop-rps-tables.php
legacy-code-rps.php
legacy-index.php
login.php
logincheck.php
newpassword-verify.php
newpassword.php
potential-code.txt
quiz-db-init.php
quizhub.php
quizhub2.php
results.php
rpsaccount-ajax-user-search.php
rpsaccount.php
rpsbetting-ajax-match-finder.php
rpsbetting.php
rpsbettingleaderboard.php
rpschangepassword.php
rpschangepassword.txt
rpsgame-ajax.php
rpsgame.php
rpsgameresults.php
rpshostnewgame.php
rpshub.php
rpsleaderboard.php
rpslib.php
rpslogin.php
rpsmaininclude.php
rpsproject/
rpsusersearch.php
table-init.php
verification.php

bacon-egg-pizza.php

26 lines ASCII Windows (CRLF)
<?php
require('rpsmaininclude.php');
ob_clean(); //rensa output buffer

$query "SELECT m.matchid, m.isactive, m.player1id, m.player2id, u.userid, u.username 
FROM matches AS m INNER JOIN rpsusers AS u
ON m.player1id = u.userid"
;
$stmt $dbconn->prepare($query);
$stmt->execute();


$output "";
while (
$res $stmt->fetch(PDO::FETCH_ASSOC)) {
    if(
$res['isactive']!=0){
        if(
is_null($res['player2id'])){
            
$key $res["matchid"];
        
$hostplayername $res['username'];
        
$output.= '<a href="rpsgame.php?matchid='.$key.'">spela med '.$hostplayername.'</a><br>';
        }
    }
}
echo 
$output;


?>