php - How do I hash SHA2 on $_POST? -


I am trying to encrypt my 'password' column with SHA2. The problem is that the injection of MYSQL is through a $ _POST variable, so I do not understand where to put SHA2 ()

Here is my 'Insert' page (Internet.fp):

    

From what I've read, I've put it in the 'Price' section of my insert query:

Attempts to combine: <('$ _POST [uname]', 'SHA2 ($ _ POST [pwrd])', '$ _ POST [bdate]', URL (url, pw RADI, BDET, MAIL) value 'INSERT' '$ _POST [MAIL]') ";

But then if the password was for example: mypass, the output in my database was this: SHA2 (mypass)

I tried: <('$ _POST [uname]', '$ _ POST [SHA2 (PWDR)]', '$ _ POST [BDT]' , '' URL, PWD, BDT, $ _POST [Mail] ') ";

But then I get a parse error (which I think, but still I'm trying ) So my question is: Does anyone know if I'm $ _POST I encrypts ??

Look at the examples again.

  mysql> Include user password (id, username, password) - & gt; Value (zero, 'Lily', SHA2 ('mypassword1', 256));   

Let's move around the quote string. The SHA2 () function goes around the call quote.

Apart from this, SHA2 () takes two argument.

  'SHA2 ($ _ POST [pwrd])' '  

should be:

  SHA2 (' $ _ POST [pwrd] ', 256)   

one ?? | But do not let the post data stick directly to your SQL, it makes you weak which you should do with yourself

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -