国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 語言 > PHP > 正文

php實(shí)現(xiàn)URL加密解密的方法

2024-05-04 23:52:33
字體:
供稿:網(wǎng)友

本文實(shí)例講述了php實(shí)現(xiàn)URL加密解密的方法。分享給大家供大家參考,具體如下:

<html xmlns="http://www.w3.org/1999/xhtml" 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>無標(biāo)題文檔</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, div, select{font-size:9pt; font-family:"宋體";}--></style></head><body><?phpfunction 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>'.print_r($_GET, true).'</pre>';function testGET(){   echo 'Function GET:<pre>'.print_r($_GET, true).'</pre>';}testGET();?><br /><br /><br /><?for($i=1; $i<10; $i++){  $s_url = query_encode('ac=index:logo& style="color: #007700">.$i);   echo sprintf('<a href="?%s">TEST: %s</a><br />', $s_url, $s_url);}?></body></html>

希望本文所述對(duì)大家PHP程序設(shè)計(jì)有所幫助。


注:相關(guān)教程知識(shí)閱讀請(qǐng)移步到PHP教程頻道。
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 卢氏县| 肃宁县| 冷水江市| 吉水县| 武穴市| 图木舒克市| 西畴县| 白山市| 逊克县| 河南省| 辽源市| 芷江| 金溪县| 库尔勒市| 开江县| 渝中区| 阳西县| 龙泉市| 孟村| 卓资县| 通江县| 新乐市| 高清| 涞源县| 定兴县| 曲阜市| 宣威市| 红安县| 临江市| 大理市| 景德镇市| 建德市| 夏河县| 孝昌县| 乌兰浩特市| 永年县| 通河县| 金华市| 奈曼旗| 陆河县| 镇雄县|