zeg1jeux/login.php

63 lines
961 B
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
require_once('config.php');
require_once('lib/Gchange.class.php');
if (isset($_POST['player'])) {
$_SESSION['player_pubkey'] = $_POST['player'];
$gchange = new Gchange();
$user = $gchange->getUser($_SESSION['player_pubkey']);
$_SESSION['player_lat'] = $user->_source->geoPoint->lat;
$_SESSION['player_lon'] = $user->_source->geoPoint->lon;
header('Location:map.php');
} else {
$bodyIds = 'login-page';
include_once('header.php');
echo '
<form method="post" action="">
<p>
<label>Joueur&nbsp;:
<select name="player">';
foreach ($players as $p) {
echo '<option value="'. $p->getPubkey() .'">'. $p->getName() .'</option>';
}
echo '
</select>
</label>
</p>
<p>
<label>
Sel :
<input type="text" name="salt" />
</label>
</p>
<p>
<label>
Poivre:
<input type="text" name="pepper" />
</label>
</p>
<p>
<input type="submit" />
</p>
</form>
';
}