大家好 代码如下
<?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 = $_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! 谢谢
$password = $_GET['password'];改成用GET