谢谢 好像实现不了 你看一下我的代码<?php //create short names for variables @ $name = $_POST['name']; @ $password = $_POST['password']; if(empty($name)||empty($password)) { //Visitor needs to enter a name and password } else if($name=='user'&&$password=='pass') { // visitor's name and password combination are correct echo '<h1>Here it is!</h1>'; echo 'I bet you are glad you can see this secret page.'; } else { // visitor's name and password combination are not correct echo '<h1>Go Away!</h1>'; echo 'You are not authorized to view this resource.'; } ?> 我就想在地址栏里 输入 http://localhost/16/secret.php?name=user&password=pass然后得到 Here it is! 谢谢
<?php //create short names for variables $name = $_GET['name']; $password = $_GET['password'];
你看一下我的代码<?php
//create short names for variables
@ $name = $_POST['name'];
@ $password = $_POST['password'];
if(empty($name)||empty($password))
{
//Visitor needs to enter a name and password
}
else if($name=='user'&&$password=='pass')
{
// visitor's name and password combination are correct
echo '<h1>Here it is!</h1>';
echo 'I bet you are glad you can see this secret page.';
}
else
{
// visitor's name and password combination are not correct
echo '<h1>Go Away!</h1>';
echo 'You are not authorized to view this resource.';
}
?>
我就想在地址栏里 输入 http://localhost/16/secret.php?name=user&password=pass然后得到 Here it is! 谢谢
<?php
//create short names for variables
$name = $_GET['name'];
$password = $_GET['password'];