Home > Backend Development > PHP Tutorial > PHP URL jump code to reduce external links

PHP URL jump code to reduce external links

高洛峰
Release: 2023-03-01 10:28:02
Original
1804 people have browsed it

URL jump code
1. Code:
If saved as aaa .php, which can achieve the effect of aaa.php?url=www.baidu.com jumping to Baidu.
This simply calls the default $_GET variable. And php default jump Location:

2. Instance upgrade: increase if loop
Code:
Copy code The code is as follows:
$url=$_GET["url"];
if (strlen($url >=3)){
header("Location:"." http://".$url);
}
?>


URL redirect page








Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template