I need to reload included page in after user clicks the specific link, which changes the tournament id.
$tournament = $_GET['tournament'];
$user = $_SESSION['user_id'];
$sql=$conn->query("SELECT *, SUM(points) as total FROM results WHERE tournament_id = '$tournament' and user_id = '$user' ");
echo 'Logged user '. $_SESSION['name'] .', score '. $data->total . 'in tournament '. $data->tournament_name; ?>
<?php include "info.php"; ?>
<div id="main">Select tornament:
<a href="competition.html?tournament=1">Tournament 1</a><br />
<a href="competition.html?tournament=2">Tournament 2</a><br />
You cannot re-execute an included PHP script once the page is generated and loaded. So you have two solutions:
Use IFRAME instead of DIV and reload it when needed.
<IFRAME id="info" src="info.php"></IFRAME>