<?php session_start(); //session_start擺在html tag之前不會出現headers already sent ?>
<html>
<?php
if(isset($_SESSION['hit']))
$_SESSION['hit']++;
else
$_SESSION['hit']=0;
?>
<head></head>
<body>
<?php echo $_SESSION['hit'];?>
</body>
<html>
<?php
if(isset($_SESSION['hit']))
$_SESSION['hit']++;
else
$_SESSION['hit']=0;
?>
<head></head>
<body>
<?php echo $_SESSION['hit'];?>
</body>
沒有留言:
張貼留言