Home > Backend Development > PHP Tutorial > 登录页面验证~~~~ 求救

登录页面验证~~~~ 求救

WBOY
Release: 2016-06-23 14:14:15
Original
733 people have browsed it

PHP SQL

if ($_POST["admin"]!=""){				$admin=$_POST["admin"];		$pwd=$_POST["pwd"];		 		$conn = new com("ADODB.Connection");  		$connstr="DRIVER=Microsoft Access Driver (*.mdb);DBQ=".realpath("../../YCHB85SAD87/#YCHB85SAD87.mdb");				$conn->open($connstr);				$sql="select * from admin where admin='$admin' and pwd='$pwd'";		$rs = new com("ADODB.RecordSet");		$rs->Open($sql,$conn,1,1);					  if(! $rs->eof){  			session_start();  			$_SESSION['username']=$rs['username']; 			 echo "<script>alert('登录成功!');window.location='main1.asp';</script>"; 			}  			else{ 			echo "<script>alert('登录失败!');history.back();</script>";  			}					}
Copy after login

Warning: (null)(): Invoke() failed: 发生意外。 Source: Microsoft OLE DB Provider for ODBC Drivers Description: 操作已被取消。

Warning: (null)(): Invoke() failed: 发生意外。 Source: ADODB.Recordset Description: 连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。 
 
新手求help

回复讨论(解决方案)

求解析

这样写验证判断不怕被注入吗?

这个测试的 依赖注入在另个文件的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template