Jump to content

*SOLVED* Have I been burned?


stewartgd1

Recommended Posts

Although I've been learning php its not what I do and I'm stuck. I want to move the hosting of my site [a href=\"http://www.franceconnections.co.uk\" target=\"_blank\"]FranceConnections[/a] from the current hosts and developers to cutt my costs. But there is a problem.

After restoring the backup on another server the site doesn't work quite right. All the pages are there, the navigation etc is fine, all the files look right and the data is all intact.

However, when you try and display [b]some[/b] records the dialogue loops back to the home page. First I was told that it was probably due to a security feature that encrypted the URLs but when I pointed out that it only affected some records and pretty well randomly so far as I could see the response was that it was probably to do with the version of php. Well that makes little sense either although the new server is a lot more recent. I have heard rumours that other people who wanted to move never got their sites working again and had to rewrite them so I'm obviously worried.

The temporary url is [a href=\"http://www.employment.me.uk/\" target=\"_blank\"]Temp Location[/a] and you will see that even on the home page some of the recent postings loop and some are fine.

I have found a function called "encrypted url" and it certainly looks odd but might be harmless - anyone fancy a look?

There's a few beers in it for anyone who sorts it.

David

function encrypted_url($sURL = "")
{
logg(basename(__FILE__)."[".__FUNCTION__."]", LOWLEVEL);

$oEncrypt = new Encryption();
$sNewURL = "?en=";

if ($sURL == "")
{
$sURL = "sREFERER_URL=".$_SERVER['REQUEST_URI'];
}
else
{
$sURL = "sREFERER_URL=".$_SERVER['REQUEST_URI']."&".$sURL;
}

logg("Before Encryption: ".$sURL, LOWLEVEL);

// $sNewURL .= rawurlencode($oEncrypt->encrypt(YEK, $sURL, 32));
$sNewURL .= rawurldecode(base64_encode($oEncrypt->encrypt(YEK, $sURL, 64)));

logg("After Encryption: ".$sNewURL, LOWLEVEL);

return $sNewURL;
}

function decrypted_url()
{
logg(basename(__FILE__)."[".__FUNCTION__."]", LOWLEVEL);

$oDecrypt = new Encryption();
// $aURLElements = array();

logg("Before Decryption: ".$_GET['en'], LOWLEVEL);

if (!isset($_GET['en']))
{
return;
}

// if (($sURL = $oDecrypt->decrypt(YEK, rawurldecode($_GET['en']))) == "")
if (($sURL = $oDecrypt->decrypt(YEK, base64_decode(rawurldecode($_GET['en'])))) == "")
{
return;
}

$aURL = explode("&", $sURL);

foreach ($aURL as $sVal)
{
$sKey = substr($sVal, 0, strpos($sVal, "="));

global $$sKey;
$$sKey = substr($sVal, strpos($sVal, "=")+1);
// $aURLElements[$sKey] = substr($sVal, strpos($sVal, "=")+1);

logg("After Decryption: ".$sKey."=".$$sKey, LOWLEVEL);
}

return;
}














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.