Jump to content
xisto Community
Sign in to follow this  
adly3000

Php Function To Format Url i did a php function to format url but it does not work help

Recommended Posts

i did a php function to format url, i will pass some $_GET variable to it and it will eliminate them from the url, and here's the code:

<?$PS = $_SERVER['PHP_SELF'];$QS = $_SERVER['QUERY_STRING'];// *** remove undesired parameters from url *** //function formaturl($remove_me1,$remove_me2,$remove_me3){	global $PS, $QS, $PS_new; //$GET	if (!strpos($PS, "?") && !empty($QS))	{		$QS_new = "?";		reset($_GET);		while (list($key,$value) = each($_GET))		{			if ($key != $remove_me1 && $key != $remove_me2 && $key != $remove_me3)			{				if(strlen($QS_new) > 1) $QS_new .= "&";				$QS_new .= $key . "=" . $value;			}		}		if (strlen($QS_new) > 1) $PS_new = $PS.$QS_new;	}	return $PS_new;}// ***************************************** //?>
any help would be appticated

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.