温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

php和html如何实现商务通跳转代码

发布时间:2021-10-19 11:14:04 来源:亿速云 阅读:109 作者:小新 栏目:web开发

小编给大家分享一下php和html如何实现商务通跳转代码,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

php商务通跳转代码

写一段商务通跳转代码,要求:

1)保证打开的是http://www.swt.com/LR/chat.aspx?from=LKT33156511

2)保证商务通中记录来源是自己的姓名拼音。

可以使用PHP跳转来实现,/swt/index.php

代码如下:

<?php
$from = isset($_GET['from'])?$_GET['from']:'';
  if($from){
    header('Location:http://lkt.zoosnet.net/LR/Chatpre.aspx?from=LKT33156511&p='.$from.'&r='.$from.'&e='.$from);
  }else{
    header('Location:http://lkt.zoosnet.net/LR/Chatpre.aspx?from=LKT33156511');
  }
?>

使用方法:/swt/?form=zhangsan

======================================================================================

商务通静态页面跳转代码

PHP跳转的方式固然方便,但受服务器环境限制,在服务器不稳定时,如果禁用PHP,跳转会失效。下面是比较不错的静态跳转方式:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>正在跳转,请稍候...</title>
<noscript>
<meta http-equiv="refresh" content="0; url=http://lvt.zoosnet.net/LR/Chatpre.aspx?id=LVT1001100" />
</noscript>
<script> var hrefstr, pos, parastr, target; target = 'http://lvt.zoosnet.net/LR/Chatpre.aspx?id=LVT1001100'; hrefstr = window.location.href; pos = hrefstr.indexOf("?"); parastr = hrefstr.substring(pos + 1); if (pos > 0) { window.location.href = target + '&' + parastr; } else { window.location.href = target; } </script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head><body>
</body>
</html>

以上是“php和html如何实现商务通跳转代码”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI