我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

使用php阻止url指定文件夹或路径

i have a Block specified Path. for example http://example.com/image or http://example.com/file.php Some one going to this path it need showing you dont have permission or redirect another page.. How to do this for Php.. give me good examples..

You can add index.php file in each and every directory that you want to prevent direct access. Inside index.php add

echo "<script>location.href='your_redirect_path';</script>"; or 

header("Location: your_redirect_path");
exit;

近期文章

  • 单击链接/按钮上的Jquery / AJAX更新表
  • 在Codeigniter控制器中使用ZendAMF
  • PHP检查字符串是否包含没有http://的URL
  • Zend_Db_Table插入大内容的问题
  • 如何将SimpleXML对象转换为PHP数组?
  • Zend Framework 2依赖注入混淆
  • PHP OR运算符有问题吗?
  • 如何处理表单中的两个提交按钮?
  • 使用动态PHP变量列表调用函数
  • 在php中调用父方法的多种方法
  • Symfony,从控制器读取实体字段
  • php undefined index..using isset()with is_array()
  • 在PHP中,为什么</ script>不显示解析错误?
  • Heredoc字符串和TCPDF来构建动态PDF
  • 用户更新MySQL数据库条目的PHP表单
  • 会话在1页加载后立即销毁[重复]
  • 将json_encode值转换为javascript数组
  • 从嵌套对象中检索特定值
  • Mysql从stats数据库中获取多个计数
  • PHP MySQLi插入获取最后一列值加1

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华