php加一个body,关于php:在Body中包含重定向

$count = 1;

if ($count > 0) {

print '

var IE_fix=true;

if(typeof IE_fix !="undefined") // IE8 and lower fix to pass the http referer

{

document.write("redirecting...");

var referLink = document.createElement("a");

referLink.href = url;

document.body.appendChild(referLink);

referLink.click();

}

else { window.location.replace("list.php?incluided"); } // All other browsers

';

} else {

print '

var IE_fix=true;

if(typeof IE_fix !="undefined") // IE8 and lower fix to pass the http referer

{

document.write("redirecting...");

var referLink = document.createElement("a");

referLink.href = url;

document.body.appendChild(referLink);

referLink.click();

}

else { window.location.replace("list.php?error"); } // All other browsers

';

}

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<?php //一段文本找到<body 标签。输出<body> “<”的位置。 ini_set("max_execution_time", "1200");//防止写错,卡死。及时退出。 $content = "<bod < body >";//要查找的目标文本。此处有换行\n // strlen($content); //如果查找<body 成功了,返回值就是结果。 if ( strpos("$content","<body") ) { echo $i=strpos("$content","<body"); } //如果查找<body 无结果, //(情况1)可能是因为目标文本body标签含空格,换行之类的字符。 //(情况2)也可能是根本没有body标签 //对情况1),先跳过空格换行等,看后面的字符是不是body,如果是,此次查询就是对的。 // 如果不是,就重新查询,且定义初始查询位置为上次查询+1,直到有结果。 //对情况2 ,就是控制循环条件,文件结束就要结束循环。 else{ $i= strpos("$content","<");//因为查询<body无结果,就不要查询<body了,而是<. $k=$j = $i+1; while ($k<strlen($content)) { while ($content[$j] == " " || $content[$j] == "\t" || $content[$j] == "\r" || $content[$j] == "\n"){ $j++; } if ($content[$j] == "b" && $content[++$j] == "o" && $content[++$j] == "d" && $content[++$j] == "y"){ echo $i;//此处是正常结束的位置。 break;//找到了,及时结束。 } else { $i = strpos("$content","<",$k); $k=$j = $i+1; } //echo $j; }//end while }//end else ?> --------------------- 作者:O_Ra 来源:CSDN 原文:https://blog.csdn.net/qq_40534785/article/details/88580141 版权声明:本文为博主原创文章,转载请附上博文链接!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值