<?php
include ('logue.php'); 
include ('entete2.php');
$idcolo = $_POST["idcolo"];
$page = "apercu";

$sql = "SELECT idjoueur FROM matgraph_users WHERE id='$idcolo'";
$res = db_mysql_Query($sql)or die('erreur sql<br>'.$sql.'<br>'.mysql_error());
$row = mysql_fetch_array($res); 

if($row[idjoueur] == $idlogin && (ctype_digit($idcolo)))
{
	$sql = "UPDATE matgraph_idjoueur SET planete='$idcolo' WHERE idjoueur='$idlogin' ";
	$res = db_mysql_Query($sql)or die('erreur sql<br>'.$sql.'<br>'.mysql_error());
}
echo '<script language="javascript" type="text/javascript">
<!--
window.location.replace("'.$page.'.php");
-->
</script>';
?>