理解一行关于连接的PHP代码 [英] To understand a line of PHP code about a connection
问题描述
以下代码中的connection()是什么?
p>
if($ user-> connection($ email,$ password)){
}
让我们假设 connection()
是伪码。
pg_prepare
和pg_execute足以创建连接?
这行代码导致我在逐个会话>生成登录系统。随后,SOers在我的代码中指出了严重的sequrity漏洞。
我找不到函数的解释connection()
。
代码似乎是伪代码给我,因为连接没有任何属性到数据库,例如
如何形成连接
$ result = pg_prepare($ dbconn,query22,SELECT passhash_md5 FROM users
WHERE email = $ 1;);
$ passhash_md5 = pg_execute($ dbconn,query22,array($ _ REQUEST ['email']));
$ user是类的实例。 p>
连接是该类中的一种方法。
$ mail& $ password是该方法的参数。
这对数组没有任何意义。您的意思是:
$ foo = array(key=>value);
也许这可以帮助你:
http://www.webstockbox.com/php/7-tutorials- on-how-to-create-a-php-login-system /
What is connection() in the following code?
Code which I do understand completely
if($user->connection($email,$password)){
}
Let's assume connection()
is pseudo-code.
Is the pg_prepare
and pg_execute` enough to create the connection?
The line caused me to omit the use of its main code in generating a login system. Subsequently, SOers pointed out severe sequrity holes in my code.
I could not find the explanation for the function connection()
.
The code seems to be pseudo-code to me, since the connection does not have any attributes to the database, for instance by
Example of how the connection should be formed
$result = pg_prepare($dbconn, "query22", "SELECT passhash_md5 FROM users
WHERE email=$1;");
$passhash_md5 = pg_execute($dbconn, "query22", array($_REQUEST['email']));
$user is an instance of a class.
connection is a method in that class.
$mail & $password are parameters to that method.
This has nothing todo with arrays. what you mean would be:
$foo = array("key" => "value");
maybe this can help you: http://www.webstockbox.com/php/7-tutorials-on-how-to-create-a-php-login-system/
这篇关于理解一行关于连接的PHP代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!