i was trying to make a random display of pictures from a certain folder but i also want to show only 1 picture for each visitor / IP, and i guess this has something to do with 'sessions'. this is the code i tried bu it doesn't seem to redirect me to index2 :
<?php
session_start();
if (!isset($_SESSION['views'])) {
$_SESSION['views'] = 1;
}
$_SESSION['views'] = $_SESSION['views']+1;
if ($_SESSION['views'] == 1) {
header("location:index2.php");
}
?>
Thanks.
Aucun commentaire:
Enregistrer un commentaire