您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php URL跳转代码 减少外链

2025/10/21 12:06:59发布13次查看
url跳转代码 
1.代码: 
<? $url=$_get["url"];header("location:"."http://".$url);?> 如保存为aaa.php,可以实现aaa.php?url=www.baidu.com跳转到百度的效果. 
这个简单的调用了默认的$_get变量.以及php默认跳转location:
2.实例升级:增加if循环 
代码: 
复制代码 代码如下:
<?
$url=$_get["url"];
if (strlen($url >=3)){ 
header(location:.http://.$url); 

?> 
<html> 
<head> 
<title>url转向页</title> 
</head> 
<body> 
<form id="url" name="url" method="get" action="#"> 
<label>http:// 
<input name="url" type="text" value="" /> 
</label> 
<input type="submit" name="submit" value="提交" /> 
</form> 
</body> 
</html>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product