这是用户登录后的代码:
setcookie("user",$entered_username, time()+(60*60*5));
setcookie("password",$entered_password, time()+(60*60*5));
header('Location: frontpage.html');
这是我在frontpage.html上的代码:
<!DOCTYPE HTML>
<html>
<head>
<?php
if (isset($_COOKIE["user"]))
echo $_COOKIE["user"] ;
else
echo "Welcome guest";
?>
</head>
<body>
</body>
</html>
这对我的wamp本地主机不起作用?有什么问题?
答案 0 :(得分:2)
httpd.conf
:
<VirtualHost *:80>
ServerName wibble.com
DocumentRoot "some directory"
<VirtualHost>
<Directory "the same directory">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
和
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
主持人(C:\Windows\System32\drivers\etc
)
添加适当的行
例如
127.0.0.1 myhost.wibble.com
答案 1 :(得分:0)
是的,他们在localhost上工作。组成一个域并将其打入/ etc / hosts。在我的电脑上,我有C:\ Windows \ System32 \ drivers \ etc,有许多主机可供开发。