上一篇: 下一篇:

PHP文件路径加密

2010年05月21日  |  15:24分类:PHP技术  |  标签:  |  638 views

使用下面的函数可以将某一个字符串转化成另一段字符串:

<?php

  function base64_url_encode($input) {
   return rtrim(strtr(base64_encode($input), ‘+/’, ‘-_’), ‘=’);
   }
$code_urlfile = ‘electr/hairstra/08661′;

echo base64_url_encode($code_urlfile);

?>

输出:ZWxlY3RyL2hhaXJzdHJhLzA4NjYx,

这样路径里面的electr/hairstra/08661 这一段就变成了ZWxlY3RyL2hhaXJzdHJhLzA4NjYx,别人就不能看到文件的真实路径了。

在zen-cart的图片显示中可以使用这样的技术来隐藏图片实际路径,增加安全性。

原创文章,转载请注明: 转载自长沙营销型网站建设,营销型网站开发,Zen-Cart | 小龙包

本文链接地址: PHP文件路径加密

喜欢本文,那就收藏到: Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网

发表您的评论

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word