Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用html表单登录 无标题1 用户名 密码_Php_Login - Fatal编程技术网

Php 使用html表单登录 无标题1 用户名 密码

Php 使用html表单登录 无标题1 用户名 密码,php,login,Php,Login,这是我的简单php文件 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" ht

这是我的简单php文件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>
    <form name="log" method="GET" action="login.php">
        username <input type="text" name="usr" style="width: 242px"></input><br>
        password <input type="password" name="psw" style="width: 242px"></input><br>
        <input type="submit" style="width: 78px" value="تسجيل الدخول">      
    </form>
</body>

</html>

当我按下提交按钮时,我期望它会打印用户名,但它给了我这个


有人能告诉我问题出在哪里吗?对不起,我的英语不好

你没有在php服务器上运行该文件。。。您只是在浏览器中读取文件,请尝试从如下URL加载页面:
http://localhost/mypage.php

您不是在php服务器上运行该文件。。。您只是在浏览器中读取文件,请尝试从如下URL加载页面:
http://localhost/mypage.php

如果您没有运行服务器,可以尝试安装wamp以便访问本地主机。您应该从
localhost
运行PHP文件。不是从
文件://
。如果您没有运行服务器,可以尝试安装wamp,以便访问您的本地主机。您应该从
localhost
运行PHP文件。不是来自
文件://
<?php
    echo $_GET["usr"];
?>