binarywebs Posted March 1, 2009 Share Posted March 1, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/ Share on other sites More sharing options...
fenway Posted March 1, 2009 Share Posted March 1, 2009 What does encrytion have to do with mysql? Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-773830 Share on other sites More sharing options...
corbin Posted March 1, 2009 Share Posted March 1, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-773847 Share on other sites More sharing options...
binarywebs Posted March 1, 2009 Author Share Posted March 1, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-773940 Share on other sites More sharing options...
corbin Posted March 1, 2009 Share Posted March 1, 2009 Can't tell for sure since I don't know what's going on in encrypt()/decrypt(), but that looks like it should work fine. Have you checked to make sure the data is actually in the DB? Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-773973 Share on other sites More sharing options...
binarywebs Posted March 2, 2009 Author Share Posted March 2, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-774521 Share on other sites More sharing options...
fenway Posted March 2, 2009 Share Posted March 2, 2009 It's utterly impossible to guess... you've made this problem impossible for anyone other than you to solve. Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-774541 Share on other sites More sharing options...
binarywebs Posted March 2, 2009 Author Share Posted March 2, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-774555 Share on other sites More sharing options...
fenway Posted March 2, 2009 Share Posted March 2, 2009 No idea... but I can move this thread to the PHP board if you'd like... Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-774640 Share on other sites More sharing options...
binarywebs Posted March 2, 2009 Author Share Posted March 2, 2009 No its ok thanks, it appears the guy who started the website is being difficult so I'll just start the bits that don't work again from scatch. Cheers for the help anyway Quote Link to comment https://forums.phpfreaks.com/topic/147432-problems-with-search-encryption-after-moving-database-to-new-domain-name/#findComment-774765 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.