I find that the PHP404pl1installer.exe setup the php+Apache entironment very well, but the session works not good as before version of php4.
The sess.php is :
<?php
if($action=="postout")
{
if(trim($name)=="" || trim($pwd)=="")
{
print "wrong enter";
}
else
{
$lines=file("reg.txt");
$shu=count($lines);
for($i =0; $i<=$shu ;$i++)
{
$rm=split("&&",$lines[$i],99);
if($rm[0]!=$name || $rm[1]!=$pwd)
{
print "too bad£¡£¡";
exit;
}
else
{
session_start();
session_register("nam");
session_register("pw");
$nam=$name;$pw=$pwd;
print "welcome,,".$nam."¡£and press hyperlink below <br>";
print "<a href='sess2.php'>test session</a>";
break;
}
}
}
}
else
{
?><center>
<form action="sess.php?action=postout" method="post">
ID<input name=name><br>
password<input name=pwd><br>
<input type=submit name=submit value="enter"> <input type=reset value="reset"></form></center>
<?php
}
?>
and the sess2.php is:
<?php
session_start();
if($nam!="" && $pw!="")
{
print $nam."nice to meet you?";
}
else
{
print "illegal user";
}
?>
it should be two session id when you post .php two times,but there is only one !I run the programm before in PHP4 ,not this version.it run very nice.What happened in this version?I don't know,please help me,thank you!!
I am a Chinese boy.I run the programm in win98+apache1_3_12+php404pl1 and Redhat