<?php
/*
* Smarty plugin
* -
* File: function.string_encription.php
* Type: function
* Name: encription
* Purpose: check string length and outputs a response
* -
*/
function smarty_function_encryptUrl($params, &$smarty) {
$key = "MEMBERSITEENCRYPTEDKEY"; //preset key to use on all encrypt and decrypts.
$result = '';
$string=$params['enstring'];
for($i=0; $i<strlen($string); $i++) {
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)+ord($keychar));
$result.=$char;
}
return urlencode(base64_encode($result));
}
?>