Bir bağlantı hakkında bir PHP kod satırı anlamak için

2 Cevap php

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?


Çizgi beni generating a login system yılında ana kod kullanımını ihmal neden oldu. Daha sonra, Soers benim kodda ciddi guvenlik delikleri dikkat çekti.

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']));                 

2 Cevap

$ Kullanıcı sınıfının bir örneğidir.

Bağlantı bu sınıfta bir yöntemdir.

$ Mail & $ Parola bu yöntemi parametrelerdir.

Bu dizilerle şey todo vardır. ne demek olurdu:

$foo = array("key" => "value");

maybe this can help you: http://www.webstockbox.com/php/7-tutorials-on-how-to-create-a-php-login-system/

Aslında php.net kullanmadıysanız, ancak bağlantı 2 params alır $ nesne kullanıcı bir yöntemdir gibi bu sadece görünüyor. Diziler ile ilgisi.