Jump to content

Problems with Search Encryption after moving Database to new Domain name


binarywebs

Recommended Posts

Hello, I've used PHP and MYSQL before but I'm now trying to learn more advanced uses of it. I have successfully moved a database from one server (mysql = 5.0.67, php = 5.2.4) to another server (mysql = 5.0.67, php = 5.2.8 ) which also has a different domain name.

 

Everything seems to have gone OK apart from the search function does not work on the new server. On the old server clicking search without selecting any criteria returns 8 users whilst on the new server below it returns none;

http://www.psm-guitar-shop.co.uk/search

 

Background info - the search has encryption, I have moved all files across to new server, some user profiles on home page will not open, I'm aware work needs doing on tick boxes to get search method perfect.

 

Could it be the change in PHP version that is causing the problem?

 

 

Link to comment
Share on other sites

Most likely the data didn't entirely restore in the DB.  Or, if it is encrypted, for some reason the encryption is different on serverb than on servera.

 

 

As for if it's being caused by PHP, I would guess no.  A minor revision isn't likely to break a script.

Link to comment
Share on other sites

Thanks for the reply. The encryption appears to have been done by the below two sets of code although I don't know much about encryption.

 

This is the code from the action page that searches the database;

if($__gSearchSubmit){

header('location: /search/'.Utilities::encrypt('SEARCH',str_replace('&','|',$_SERVER['QUERY_STRING'])));

exit;

}

 

if($aParameters[1]){

$aSearchParams=explode('|',Utilities::decrypt('SEARCH',$aParameters[1]));

foreach($aSearchParams as $sSP){

if(strpos($sSP,'=')!==0){

$aSP=explode('=',$sSP);

${'__p'.$aSP[0]}=$aSP[1];

}

}

if($__pSearchSubmit){

if($__pUsername){

$sSQL[]="m.sUsername LIKE '%".Database::sanitize($__pUsername)."%'";

}

 

 

 

 

---------And this is the beginning bit of code from the utilities page that is requested in the above script;

 

# Encryption routine variables

 

static private $_Scramble1 = array(' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./-:_+,#=|','0123456789ABCDEFabcdef');

static private $_Scramble2 = array(fdsgfgdU2q|14y5/y45,4fdgdfgP.dF=Vm DTcS:Zerl#G+KuCyJx-HiQLtRgfhfghfghYnb0X','dFe95fghfghf8C70b2Df61');

static private $_Adj = 1.75;

static private $_Mod = 3;

 

------I've changed some of the encryption letters and numbers just in case its a security leak.

 

Is there something else I need to do from the moving over of the database?

 

Cheers

Link to comment
Share on other sites

Yes I've just double checked to make sure the data is in the database, some profiles will not show either (vitalia on home page wont but Glyn Jones Will) so I'm wondering if there is something more widespread wrong.

 

 

The background to this is that I am helping someone out with their website as the other developer let them down with a half finished website. I have just found out that the working website is connecting to a database on the other guys server and not the copy that I have been given which is on their server.

 

Although all the data appears to be in the database could there be something missing from the copy of the database I have or is it likely to be a code file I am missing?

 

 

Link to comment
Share on other sites

It's utterly impossible to guess... you've made this problem impossible for anyone other than you to solve.

 

I think maybe I led this post down the wrong route and the database is just a side issue and the question I should have been asking is;

 

Does PHP encryption work similar to .htpasswd where by there is a text file that contains the paswords or in this case an encryption key or some vital data?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.