服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|JavaScript|易语言|

服务器之家 - 编程语言 - PHP教程 - php 实现简单的登录功能示例【基于thinkPHP框架】

php 实现简单的登录功能示例【基于thinkPHP框架】

2021-09-18 16:41zhaoyangjian724 PHP教程

这篇文章主要介绍了php 实现简单的登录功能,结合实例形式分析了基于thinkPHP框架登录功能视图与控制器简单实现技巧,需要的朋友可以参考下

本文实例讲述了php 实现简单的登录功能。分享给大家供大家参考,具体如下:

//登录页面:

V层前端模板:

Administrator@QCEE61NZ66FEX2D /cygdrive/c/wamp/www/thinkphp/Home/Tpl/Login
$ ls

index.html

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!doctype html>
<html lang="en">
 <head>
 <meta name="Generator" content="EditPlus?">
 <meta name="Author" content="">
 <meta name="Keywords" content="">
 <meta name="Description" content="">
 <title>Document</title>
 </head>
 <body>
 <!doctype html>
<html lang="en">
 <head>
 <meta name="Generator" content="EditPlus?">
 <meta name="Author" content="">
 <meta name="Keywords" content="">
 <meta name="Description" content="">
 <title>Document</title>
 </head>
 <body>
 <center>
 <h1>中均运维管理平台</h1>
  <!--图片标签-->
<img src="__PUBLIC__/Images/scan.jpg"/>
 </center>
 <form>
 <center>
 用户名:<input type='text' name='username'/><br/>
 密 码:<input type='passwords' name='password'/><br/>
 验证码:<input type='text' name='code'/><br/>
 <input type='submit'/>
 <center/>
<!-- <table width="600" hborder="0" cellspacing="0" cellpadding="0">
<tr>
<td>用户名:</td>
<td><input type="text" name="username"/></td>
<td>密码:</td>
<td><input type="password" name="password"/></td>
<td><input type="button" name="login" value="login"/></td>
</tr> -->
 </form>
 </body>
</html>
 </body>
</html>

// C层类

Administrator@QCEE61NZ66FEX2D /cygdrive/c/wamp/www/thinkphp/Home/Lib/Action
$ ls -ltr LoginAction.class.php

?
1
2
3
4
5
6
7
<?php
 class LoginAction extends Action {
 function index(){
  $this->display();
 }
}
?>

希望本文所述对大家基于ThinkPHP框架的PHP程序设计有所帮助。

原文链接:https://blog.csdn.net/zhaoyangjian724/article/details/51159932

延伸 · 阅读

精彩推荐