私の最初のphpファイルはbasic.phpです
<?php
session_start();
?>
<html>
<body>
<a href="basic2.php? name=qadeerhussain"> click on it</a>
<?php
$_session['username']="qadeerhussain";
print $_session['username'];
?>
</body>
</html>
Out put of basic.php
is: クリックしてくださいqadeerhussain
私の2番目のbasic2.php
ページは
<?php
session_start();
?>
<html>
<body>
<?php
print $_SESSION['username'];
?>
</body>
</html>
しかし、それは私に次の例外を与えます:
Notice: Undefined index: username in C:\wamp\www\test\basic2.php on line 12