Hi,
in this program , I defined some variables and their value,
such as "$adminidL='$set[1]'; $adminpwdL='$set[2]'; " and wrote them into another file (config.php)for future use, the in addmin.php I use them to varify...such as use $adminwdL and $adminidL to check log in... but it always unmatched..why? Can I transfer variable from one program to another one like this sentence?
$step="<a href=admin.php>success and enter admin</a>";
and when code goes to admin.php, I want to use the variables defined in install.php (such as $adminidL)
install.php
...
.....
$set[2]=MD5('$set[2]');
$filecontent="<?
\$adminidL='$set[1]';
\$adminpwdL='$set[2]';
\$title='$set[3]';
\$picpath='$set[4]';
\$refresh_allowed=$set[5];
\$online_limit=$set[6];
\$perpage1=$set[7];
\$perpage2=$set[8];
\$negdsupport='$set[9]';
\$max_upload_size=$set[10];
\$hot_view_no=$set[11];
\$style='$set[12]';
";
writetofile("config.php",$filecontent);
if(!mkdir("$set[4]", 0777)) {$body="set dir failed£¬pls set up$set[4]£¬and change mod0777<br><br>";
}
if (!is_writable($set[4])) $body.="dir{$set[4]}is now writable£¬chmod 0777<br><br>";
$body.="config finish<br><br>";
$step="<a href=admin.php>success and enter admin</a>";
}
$color[0]='blue';
$color[1]='blue';
$color[2]='blue';
$color[3]='blue';
$color[4]='blue';
$color[$step]='red';
?>
Admin.php
<?
/*
*/
//session_name('s');
//session_start();
$time_s=time();
$admin_body='';
require_once("global.php");
$pictime=get_date($time_s);
if (empty($adminid)) $adminid=$HTTP_SESSION_VARS['adminid'];
if (empty($adminpwd)) $adminpwd=$HTTP_SESSION_VARS['adminpwd'];
if($adminid != $adminidL || MD5('$adminpwd') != $adminpwdL) {$admin_body="
<TABLE id=AutoNumber2 style=\"BORDER-COLLAPSE: collapse\" borderColor=#c0c0c0 cellSpacing=20 cellPadding=0 width=100% align=center border=1>
<TBODY>
<TR>
<TD width=100%>
<FORM action=admin.php method=post>
<P>Administration Log in</P>
<P>Username:</SPAN><INPUT type=text name=adminid></P>
<P>Password:</SPAN><INPUT type=password name=adminpwd></P>
<P></P>
<P><INPUT type=submit value=Admin Login> <input type=reset value=reenter></P></FORM></TD></TR></TBODY></TABLE><BR>
";
$body=getTemplate("admin");
eval ("\$body.= \"".$body."\";");
$main=getTemplate("main");
eval ("\$index.= \"".$main."\";");
echo "$index";
exit;
}
if(empty($HTTP_SESSION_VARS['adminid'])){
session_register("adminid");
session_register("adminpwd");
}
......
......