J'ai un petit problème avec le compteur des pages vues, il doit être incrémenter par 1 mais il s'incrémente par 2.
<?php
echo 'accueil';
################################## select to show the data #######################################
$select_sd = 'SELECT * from sds WHERE id_sd=1';
$result_sd = mysql_query ($select_sd) or die ('Erreur de selection: ' .mysql_error());
$total_sd = mysql_num_rows($result_sd);
if ($total_sd) {
$row_sd = mysql_fetch_array($result_sd);
$id_sd = $row_sd['id_sd'];
$classement = $row_sd['classement'];
$title_ar = $row_sd['title_ar'];
$title_en = $row_sd['title_en'];
$description = $row_sd['description'];
$url = $row_sd['url'];
$hits = $row_sd['hits'];
echo '<br>hits:'.$hits.'<br>';
echo 'id sd:'.$id_sd.'<br>';
include 'Included_Files/Replacement.php';
$counter = $hits + 1;
echo 'counter'.$counter.'<br>';
echo '<div align="center">Page vue: '.$hits.' fois and was generated on xxxx seconds</div><br>';
################################## update the counter for hits #######################################
$update_sd = "UPDATE sds SET hits = $counter WHERE id_sd = 1";
echo $update_sd.'<br>';
$rup_sd = mysql_query($update_sd) OR DIE ('Erreur update: '. mysql_error());
}
?>
merci pour votre aide