CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> PHP

 How to encrypt the values in the Login form

Print topic Send  topic

Author Message
Joseph Gilbert-Baffoe
Posted: 01/08/2004, 12:02 AM

I am using CodeChargeStudio for the first time, I have selected the "PHP 4.0
with Templates" option with MYSQL as the database. I am using

I have an application with the login id and password and several other
fields encrypted in the database using AES_ENCRYPT ("value", key) where
value is the data to be encrypted and key is the code used by AES_ENCRYPT to
encrypt value.

My problem is with the CodeChargeStudio login form; how can I get the values
entered on the login form to be encrypted with AES_ENCRYPT before they are
compared with the encrypted data in the database?

Any help in resolving this is greatly appreciated.

Thanks in advance.


Joseph Gilbert-Baffoe
Nimrix, Inc


Posts: 712
Posted: 01/08/2004, 12:54 AM

Use Before Insert or Before Update Event
View profile  Send private message
Posted: 01/08/2004, 7:31 AM

You can add the custom code into the login OnClick event above login action and write the following code:

global $DBConnection1;
$new_pass = CCDLookUp("AES_ENCRYPT ($form_name->password->GetValue(), $key)","","',$DBConnection1);

Joseph Gilbert-Baffoe
Posted: 01/09/2004, 11:28 PM


Looks like I am missing something in the custom code, the
"CCDLookUp("AES_ENCRYPT ($form_name->password->GetValue()" part is not
returning a value.

I tried different options like using single quotes and combining single and
double quotes but non seem to get the CCDLookUp to return a value.
$ekey returns the expected value of 'somestring'.

I already declared all the variables as global.

This is what I have ...
$new_login = CCDLookUp("AES_ENCRYPT($Login->loginid->GetValue(),
echo "***".$new_login."***";
$new_pass = CCDLookUp("AES_ENCRYPT($Login->password->GetValue(),
echo "****".$new_pass."****";

And this is the result...
Debug: query = SELECT AES_ENCRYPT(Object->GetValue(), 'somestring')
Database error: Invalid SQL: SELECT AES_ENCRYPT(Object->GetValue(),

Any clue as to what is missing from my statement?

Thanks againg for your assistance

Joseph Gilbert-Baffoe
Nimrix, Inc

"Al" <Al@forum.codecharge> wrote in message
> You can add the custom code into the login OnClick event above login
action and write the following code:
> global $DBConnection1;
> $new_pass = CCDLookUp("AES_ENCRYPT ($form_name->password->GetValue(),
> $form_name->password->SetValue($new_pass);
> ---------------------------------------
> Sent from YesSoftware forum


Posts: 586
Posted: 01/13/2004, 6:36 AM

In fact you have to use both suggestions:
1. encrypt the value in the Before Build Insert/Update events while updating the users table;
2. encrypt the password in the onClick event of Login button

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Web Database

Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.