IN the following piece of code, when I click "next " I should go to installation step by step, why there is no response when I test it?
This program is working well on unix, do I need modify something when use it on winxp????
<?php
/
===========================================
By Winston Liang
- ===========================================
*/
if(file_exists("config.php")){echo" finish installation"}
function readfromfile($file_name) {
global $readno;
$readno++;
$filenum=@fopen($file_name,"r");
flock($filenum,LOCK_SH);
$file_data=fread($filenum,filesize($file_name));
fclose($filenum);
return $file_data;
}
function writetofile($file_name,$data,$method="w") {
global $writeno;
$writeno++;
$filenum=@fopen($file_name,$method);
flock($filenum,LOCK_EX);
$file_data=fwrite($filenum,$data);
fclose($filenum);
return $file_data;
}
$correct='<font color=blue>OK</font>';
$incorrect='<font color=red>not pass</font>';
$check=1;
if(empty($step)) $step=0;
if($step==0){
$body="Welcome<br><br><br><br>Imagiq<br>QQ£º117115<br>email:liang@cs.dal.cam<br>http://www.cs.dal.ca/~liang<br><br><br><br>";
$step_="<a href=install.php?step=1>next</a>";
}
elseif($step==1){ // <====why no change even if I click the link????
$body="check if all program here<br><br><br>";
$filestocheck=array(
'index.php','global.php','display.php','readpic.php','search.php','smallpic.php','test.php','admin.php');
$count=count($filestocheck);
for ($i=0; $i<$count; $i++) {
$body.= "$filestocheck[$i] ....... ";
if (file_exists($filestocheck[$i])) {$body.= $correct; echo "hhjkjkjlkjkl";}
else { $body.= $incorrect; $check=0; }
$body.= "<br>";
}
$body.= "<br><br>";
if($check==1)$step="<a href=install.php?step=2>next</a>";else $step="program integrity";
}
elseif($step==2){
$body="check if root dir can be written<br><br>";
$body.= "root dir ....... ";
if ($fp=fopen('test.test',"w")) {$body.= $correct; fclose($fp);}
else { echo $incorrect; $check=0; }
$body.= "<br>TMP dir ....... ";
if(is_writable("tmp")){$body.= $correct; }
else { echo $incorrect; $check=0; }
$body.= "<br>";
unlink('test.test');
if($check==1)$step="<a href=install.php?step=3>next</a>";else $step="check property of root dir(0777 if unix)";
}
elseif($step==3){
$body="input config parameters<br><br>
<FORM action=install.php method=post>
<TABLE borderColor=#c0c0c0 cellSpacing=5 cellPadding=0 width=\"100%\" border=0>
<TBODY>
<TR>
<TD width=\"30%\">Website name£º</TD>
<TD width=\"70%\"><INPUT value=\"my gallery\" name=set[3]></TD></TR>
<TR>
<TD width=\"30%\">upload path£º</TD>
<TD width=\"70%\"><INPUT value=\"images/\" name=set[4]>remember add /</TD></TR>
<TR>
<TD width=\"30%\">maximum size of upoloading file£º</TD>
<TD width=\"70%\"><INPUT value=\"400\" name=set[10] size=6>K</TD></TR>
<TR>
<TD width=\"30%\">model path£º</TD>
<TD width=\"70%\"><INPUT value=\"bym\" name=set[12]>no /</TD></TR>
<TR>
<TD width=\"30%\">time online:</TD>
<TD width=\"70%\"><INPUT value=\"1800\" name=set[6]>£¨second£©¡¡</TD></TR>
<TR>
<TD width=\"30%\">sub categories of each page£º</TD>
<TD width=\"70%\"><INPUT value=\"4\" name=set[7]></TD></TR>
<TR>
<TD width=\"30%\">pictures in each page£º</TD>
<TD width=\"70%\"><INPUT value=\"4\" name=set[8]></TD></TR>
<TR>
<TD width=\"30%\">time for anti-fresh¡¡</TD>
<TD width=\"70%\"><INPUT value=\"2\" name=set[5]>£¨second£©</TD></TR>
<TR>
<TD width=\"30%\">maximum number of hot images¡¡</TD>
<TD width=\"70%\"><INPUT value=\"30\" name=set[11]></TD></TR><TR>
<TD width=\"30%\">¡¡</TD>
<TD width=\"70%\"></TD></TR>
<TR>
<TD width=\"100%\" colSpan=2><A href=\"test.php\" target=_blank>next to test GD enviroment</A>£¬if OK , you can use the followings¡£</TD></TR>
<TR>
<TD width=\"100%\" colSpan=2>
<TR>
<TD width=\"30%\">starting GD support£º</TD>
<TD width=\"70%\"><INPUT value=\"enable\" name=set[9]> [enable/disable]</TD></TR>
<TR>
<TD width=\"30%\">¡¡</TD>
<TD width=\"70%\"></TD></TR>
<TR>
<TD width=\"30%\"><font color=red>administrator¡¡</font></TD>
<TD width=\"70%\"><INPUT value=\"admin\" name=set[1]></TD></TR>
<TR>
<TD width=\"30%\"><font color=red>administrator password¡¡</font></TD>
<TD width=\"70%\"><INPUT value=\"\" name=set[2]><br>We use MD5 for encryption</TD></TR>
</TBODY></TABLE>
<P><INPUT type=hidden value=4 name=step><INPUT type=hidden value=option name=action> <INPUT type=submit value=next> </FORM></P><BR>";
....
....
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber5" align="center">
<tr>
<td width="1" background="img/spacer2.gif">¡¡</td>
<td width="226" valign="top">
<p align="center"><br><br>
<table width="90%" border="0" cellspacing="1" cellpadding="0" align=center bgcolor="#868f98" >
<tr >
<td height="22" width="100%" align=left><font color=#292929> image program</font>
</td>
</tr>
<tr><td valign="top" align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr bgcolor=#ffffff>
<td valign="top" height="422">
<br><br>installation progress£º
<br><br><br><p>
<font color=<?=$color[0]?>>step 1£ºwelcome</font></p><p>
<font color=<?=$color[1]?>>step2: check if all program there</font></p><p>
<font color=<?=$color[2]?>>step3: check if dir writable</font></p><p>
<font color=<?=$color[3]?>>step 4£ºconfig</font></p><p>
<font color=<?=$color[4]?>>step 5.£ºsuccess</font></p>
</td></tr>
</table>
</td></tr></table>
</p>
¡¡</td>
<td width="1" background="img/spacer2.gif"></td>
<td width="10">¡¡</td>
<td width="513" valign="top"><p><br>
СÔÂͼƬ³ÌÐò£¬°²×°³Ìʽ
<hr color="#C0C0C0" align="left" width="96%" size="1">
<?=$body?>
<hr color="#C0C0C0" align="left" width="96%" size="1">
<p align="right"><?=$step_?><span lang="zh-cn"> </span>
</p>
</p>
</p>
</td>
<td width="1" background="img/spacer2.gif">¡¡</td>
</tr>
</table>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber6" background="img/spacer1.gif" height="1">
<tr>
<td width="100%"><spacer type=block width=1></td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber7" bgcolor="#C0C0C0" height="5">
<tr>
<td width="100%"><spacer type=block width=1></td>
</tr>
</table>
</center>
</div>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber8" align="center">
<tr>
<td width="100%" background="img/spacer1.gif" height="1"><spacer type=block width=1></td>
</tr>
<tr>
<td width="100%"><img border="0" src="img/footer.gif" width="768" height="20"></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" height="1"><spacer type=block width=1></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber9" bgcolor="#000000" height="1" align="center">
<tr>
<td width="100%"><spacer type=block width=1></td>
</tr>
</table>
</body>
</html>