NameSilo

[Php] Encoding URL - Change encoding

Spaceship Spaceship
Watch
Impact
91
Hi PHP Gurus

I need your help again!! please see http://pastebin.com/m20da3c65

I am trying to create a new encoding system for the URLs of my proxies. For this I need to edit proxifyURL() and deproxifyURL() functions which are given in the pastebin above.

I am looking to add some sort of a key mechanism where i can specify a key and change it daily so that my website remains unblocked.

Any kind of help / guidance/ tutorial / codes will be highly appreciated.

thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
bump
 
0
•••
Lots of ways to do this, I'll just post one I have already written.
PHP:
<?php

$string = 'http://google.com/search?q=Hello';

$key = (int) date("j");
/** This value can obviously be hard coded too, if you need it to be. */

function encode($string)
{
	global $key;
	$array = str_split($string);
	foreach($array as &$a)
	{
		$a = ord($a);
		$a = $a * $key;
	}
	$string = implode('_',$array);
	return $string;
}

function decode($string)
{
	global $key;
	$array = explode("_", $string);
	foreach($array as &$a)
	{
		$a = $a / $key;
		$a = chr($a);
	}
	$string = implode('', $array);
	return $string;
}

?>
 
0
•••
http://pastebin.ca/888994
i removed the base_64 encoding in the previous one and added urs but it is returning these strings 0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0 for whatever i input :(
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back