Login   Register  
PHP Classes
elePHPant
Icontem

File: urlencrypt.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of BasicA  >  TOTAL URLEncrypt  >  urlencrypt.php  >  Download  
File: urlencrypt.php
Role: ???
Content type: text/plain
Description: Encrypt your URLs to create that aura of mystery for your site ;)
Class: TOTAL URLEncrypt
Author: By
Last change:
Date: 13 years ago
Size: 890 bytes
 

Contents

Class file image Download
<?php

	/* 
	  This is a very simple script to FULLY encrypt your URL
	  
	  Email: basica@k-designs.com.sg
	  URL(NORMAL): http://staff.k-designs.com.sg/basica/
	  URL(ENCRYPTED): http://%73%74%61%66%66%2e%6b%2d%64%65%73%69%67%6e%73%2e%63%6f%6d%2e%73%67/%62%61%73%69%63%61/ 
	  
	*/

	function URLEncrypt($URL) {
	
		$Escaped = "";		

		for ($i = 0; $i < strlen($URL); $i++) {
			
			if (substr($URL, $i, 1) == "/") {
				$HEXConv = "/";
				$Escaped = $Escaped . $HEXConv;
				$i += 1;
				if ($i >= strlen($URL)) break;
			}
			
			$HEXConv = DecHex(ord(substr($URL, $i, 1)));
			$Escaped = $Escaped . "%$HEXConv";
		}

		return $Escaped;

	}

	function phpNavigate($URL) {
		print "<script language=javascript>location.href='$URL'</script>";
	}
	
	$TURL = "http://" . URLEncrypt("staff.k-designs.com.sg/basica/");
	phpNavigate($TURL);
	
?>