<?php
session_start();
// store session data
$_SESSION['count']=0; ?>
<html><head></head>
<body>
<?php include ("getElement.php");
echo getLinkButton("myscript.php", "myscript.php");
echo $_SESSION['count']++; ?>
</body>
</html>
上述工程的代碼上,但是當我點擊鏈接導航到myscript.php:
<?php
echo $_SESSION['count'];
?>
我得到這個錯誤: 未定義的變量:在_SESSION /home/ubuntu/public_html/myscript.php第2行