Please i want to set sessions in my php file which includes
a form but the session doesn't work.This is my code sample.
I need help please!
<?php
$conn=mysql_connect("localhost","root","");
mysql_select_db("my_db");
session_start();
if(isset($_SESSION['count']))
$_SESSION['count']=$_SESSION['count']+1;
else
$_SESSION['count']=1;
if(!($_SESSION['count']=$_POST['reg']))
die("SESSION NOT SET SUCCESSFULLY!");
else
echo "SESSION SUCCESSFUL!";
?>
<html><head></head><body>
<form method="POST" action="<?php echo $PHP_SELF ?>">
<input type = "hidden" name = "reg" value = "<?php echo $_SESSION['count'];?>" />
<!-- FORM INPUT -->
</body></html>