舍力博客是记录舍力学习和成长的自媒体博客;关注网站SEO技术及互联网发展,免费分享Emlog建站教程、Emlog模板、Emlog插件、SEO教程及SEO优化排名实战心得!
首页 关于本站 网站模板
代码教程
  • Emlog教程
  • 米拓教程
  • SEO优化教程
  • Ecshop教程
  • zblog教程
  • Excel技巧
  • 电脑软件教程
  • 互联网
  • 免费资源
  • 网络新闻
  • 留言咨询
  • 在线问答
  • 申请友链
  • 网址导航
  • 联系舍力
    舍力
    登录
    侧边栏壁纸
    博主头像
    舍力

    静以修身。

    • 累计撰写 1140 篇文章
    • 累计收到 3627 条评论
    • 首页
    • 栏目
      • 首页
      • 关于本站
      • 网站模板
      • 代码教程
        • Emlog教程
        • 米拓教程
        • SEO优化教程
        • Ecshop教程
        • zblog教程
        • Excel技巧
        • 电脑软件教程
      • 互联网
        • 免费资源
        • 网络新闻
      • 留言咨询
        • 在线问答
        • 申请友链
        • 网址导航
      • 联系舍力
    存档于 【201903】 的文章
    • 一款简单的php 延时跳转代码分享 2019-3-28
      一款简单的php 延时跳转代码分享 Web开发中经常会遇到页面跳转或延时跳转的需求,掌握各种页面跳转方式非常必要;以下是舍力总结有用PHP实现跳转的方法,例子皆为三秒后跳转到指定的页面。 <?php $url=$_SERVER; $str=str_replace("http://","",$url); $str=str_replace("https://","",$url); $strdomain = explode("/",$str); $domain=$strdomain; if($domain==''){ empty($_SERVER) or exit('Access Denied');//防止快速刷新 session_start(); $seconds = '30'; //时间段 $refresh = '3'; //刷新次数 //设置监控变量 $cur_time = time(); if(isset($_SESSION)){$_SESSION += 1; }else{$_SESSION = 1;$_SESSION = $cur_time;} //处理监控结果 if($cur_time - $_SESSION < $seconds){if($_SESSION >= $refresh){ //跳转至攻击者服务器地址 header(sprintf('Location:%s', 'http://127.0.0.1'));exit('Access Denied');} }else{$_SESSION = 0;$_SESSION = $cur_time;} echo 'Access Denied';exit;} //跳转结果 $urlhttp= strtolower(substr($_REQUEST,0,7)); $urlhttps=strtolower(substr($_REQUEST,0,8)); if($urlhttp=='http://'||$urlhttps=='https://'){$slurl=$_REQUEST;}else{$slurl='http://'.$_REQUEST;} $web=preg_replace('/(http:\/\/|https:\/\/|)*/','',$_REQUEST); header("HTTP/1.1 301 Moved Permanently"); header("Refresh:3;url=".$slurl.""); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=11,IE=10,IE=9,IE=8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0"> <meta http-equiv="Cache-Control" content="no-transform"> <meta http-equiv="Cache-Control" content="no-siteapp"> <title>网页3秒将跳转到<?php echo $web;?></title> <style type="text/css"> <!-- body{background-color:#F7F7F7;font-family:Arial;line-height:150%;} .main{background-color:#FFFFFF;font-size:12px;color:#666666;max-width:650px;margin:60px auto 0px;border-radius:10px;padding:30px 10px;list-style:none;border:#DFDFDF 1px solid; overflow:hidden;} .main h6{line-height:30px;font-size:18px;margin:5px 20px;} .main p{line-height:25px;font-size:14px;margin:5px 20px;} --> </style> </head> <body> <div class="main"> <h6>您所访问的页面将跳转到第三方网站,可能会有安全风险,望知悉!!!</h6> <p>3秒后将自动为你跳转到<?php echo $web;?></p> <div style="clear:both;text-align:center;font-size:14px; margin-top:50px;">本页由舍力提供</div> </div> </body> </html> 使用方法:建立一个文件夹例如go,然后在文件夹中创立一个index.php文件,把上面的代码放入到这个index.php文件中即可。 代码中加入了不能直接打开和简单的防刷新代码。 格式:www.shuyong.net/go/?url=dh.shuyong.net 演示地址(直接点击打开,复制打开无效):www.shuyong.net/go/?url=dh.shuyong.net
      • 2019年3月28日
      • 8035 阅读
      • 6 评论
      代码教程
    博主栏壁纸
    博主头像 舍力

    静以修身。

    1140 文章数
    3627 评论量
    • emlogpro实现分站功能(同一后台,不同前端)
    倒计时
    最新评论
    • 肥饶
      肥饶
      1 年前
      这个好  随机
    • 爱比宝
      爱比宝
      2 年前
      好工具,谢谢分享
    • 上海网站建设
      上海网站建设
      2 年前
      感谢分享
    • ET聊
      ET聊
      3 年前
      分享资源交流经验
    • 百胜综合盘
      百胜综合盘
      3 年前
      很8错!感谢分享
    • 百科情报站
      百科情报站
      3 年前
      你这网站可以哦, 来换个友链吧
    • 舍力
      舍力
      3 年前
      @言之在线:win10都还没有弄明白呢
    • 言之在线
      言之在线
      3 年前
      win11好还是win10好
    • 天兴工作室
      天兴工作室
      3 年前
      网站整改,我网站友链全部下了,麻烦我的链接也可以删掉了
    • 贵金属回收
      贵金属回收
      3 年前
      善良让这世界有了温暖,如果都是冷漠,那多无趣
    载入天数...载入时分秒...
    基于宝塔面板,数据存储于阿里云ECS 粤ICP备11021420号