把你全部的配置贴上来!
想支持PHP,仅仅那2句是不够的!
ScriptAlias /php4/ "C:/php4/"
Addtype application/x-httpd-php4 .php
Addtype application/x-httpd-php4 .phtml
Addtype application/x-httpd-php4 .php3
Addtype application/x-httpd-php4 .php4
Action application/x-httpd-php4 "/php4/php.exe"
想支持PHP,仅仅那2句是不够的!
ScriptAlias /php4/ "C:/php4/"
Addtype application/x-httpd-php4 .php
Addtype application/x-httpd-php4 .phtml
Addtype application/x-httpd-php4 .php3
Addtype application/x-httpd-php4 .php4
Action application/x-httpd-php4 "/php4/php.exe"
<html>
<title>会员登录网站</title>
<body>
<font size=5 color=green>登录画面</font>
<font color=red><?echo $errmsg;?></font>
<hr>
<form action=ch4-12b.php method=POST>
<table border=0>
<tr>
<td>姓名:</td><td><input type=text size=20 name=name></td>
<td><input type=submit name=SEND value=登录></td></tr>
</table>
</form>
<a href=ch4-12c.php>会员专用网页</a>
</body>
</html>
ch4-12b<?
If($name =="")
{
$errmsg="输入字段不可为空白!";
Header("Location:ch4-12a.php?errmsg=$errmsg");
}
Else
Header("Location:ch4-12c.php?user=$name");
?>
ch4-12c
<?
If($user=="")
{
$errmsg="您必须先进行登录才能进入会员专区!";
Header("Location:ch4-12a.php?errmsg=$errmsg");
}
Else
Setcookie("user",$user,Time( )+30*86400);
?>
<html>
<title>会员专用网页</title>
<body background=bground.gif>
<font size=5 color=red>会员专区</font>
<hr>
<font size=5 color=blue><?echo $user;?></font>,观迎光临会员专区
</body>
</html>
开头加上
$name = $_POST["name"];ch4-12c
开头加上
$user = $_POST["user"];教材版本太低了
将register_globals 设为on即可!