You are here: how to prep $_POST field for MySQL's AES_ENCRYPT() ?? « PHP Language « IT news, forums, messages
how to prep $_POST field for MySQL's AES_ENCRYPT() ??

Posted by Paul on 08/27/07 18:15

I want to add a binary element (AES_ENCRYPT()) to a $_POST array. I need to
make it binary because it is going into a BLOB field.

$results = $dbr->Execute('select * from table1 where id='.$_GET['id']);
....
// validation take place and now is processed
$_POST["field1"] = $dbr->GetOne('select
AES_ENCRYPT('.trim($_POST['field1']).', \'salt*&)#\')');
// there are other $_POST fields that are in cluded in the next line
// GetInsertSQL is a function that eventually calls $dbr->Execute()
$dbr ->GetInsertSQL($results, $_POST, true);
It decrypts most records (field1) but not all. After researching it, I think
the problem lies in how I am adding the encrypted field.

I think I need to make the $_POST["field1"] binary, somehow.

If so, how do I do that?

Any other ideas?

(the $dbr is an ADODB element.)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация