这篇文章主要介绍了php实现url加密解密的方法,结合实例形式分析了php针对url字符串进行加密解密操作的相关技巧,需要的朋友可以参考下
具体如下:
芒果系统GSHOP 纯静态商城系统,你还在为商城的优化而苦恼?GSHOP是全站纯静态商城系统,一键seo优化功能解决seo问题,自定义URL链接解决商城同质化问题;多页面显示:动态页、伪静态页面、纯静态页面增加收录,提升网站权重,提升流量等。安全稳定、功能强大的商城系统。1、芒果商城系统基于 php5.0开发,企业级应用。2、产品功能Ajax设计,响应速度更快,购物体验更好。3、全新密钥存放机制,
<html xmlns="#" lang="zh-CN">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<meta http-equiv="content-language" content="zh-CN" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="widow-target" content="_top" />
<meta name="robots" content="index, follow" />
<meta name="author" content="3945, [email]ljm77@km169.net[/email]" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="copyright" content="Copyright 3945 All Rights Reserved" />
<title>无标题文档</title>
<style type="text/css">
<!--
a, a:link{text-decoration: none; color:#000000; font-size:9pt;} a:visited{text-decoration: none; color:#000000;} a:hover{text-decoration: underline; color:red;}
body, td, p, li, p, select{font-size:9pt; font-family:"宋体";}
-->
</style>
</head>
<body>
<?php
function query_encode($sQuery)
{//加密链接
if(strlen($sQuery)==0)
{
return '';
}
else
{
$s_tem = preg_replace("/&/i", '&', $sQuery);
$s_tem = preg_replace("/&/i", '&', $s_tem);
$a_tem = explode('&', $s_tem);
shuffle($a_tem);
$s_tem = implode('&', $a_tem);
$s_tem = rawurlencode($s_tem);
$s_tem = base64_encode($s_tem);
$s_tem = strrev($s_tem);
return $s_tem;
}
}
function query_decode($sEncode)
{//解密链接
if(strlen($sEncode)==0)
{
return '';
}
else
{
$s_tem = strrev($sEncode);
$s_tem = base64_decode($s_tem);
$s_tem = rawurldecode($s_tem);
return $s_tem;
}
}
function rebuild_GET()
{//重写$_GET全局变量
$_GET = array();
$s_query = $_SERVER['QUERY_STRING'];
if(strlen($s_query)==0)
{
return;
}
else
{
$s_tem = query_decode($s_query);
$a_tem = explode('&', $s_tem);
foreach($a_tem as $val)
{
$tem = explode('=', $val);
$_GET[$tem[0]] = $tem[1];
}
}
}
rebuild_GET();
echo 'GET:<pre class="brush:php;toolbar:false;">'.print_r($_GET, true).'';
function testGET()
{
echo 'Function GET:'.print_r($_GET, true).''; } testGET(); ?>
for($i=1; $i.$i); echo sprintf('TEST: %s
', $s_url, $s_url); } ?>










