PHP One-line implementation of the URL steering code

Source: Internet
Author: User
Very low, learn PHP can be done in half an hour.

Reference:

$url =$_get["url"];header ("Location:".) http://". $url);? >
very simple. Ask yourself.
With links: http://bbs.blueidea.com/viewthread.php?tid=2853779
That's the idea of the 5 floor. The file name is saved as viewthread.php, the variable name is TID, the value is 2853779, and the value corresponds to the database call.

Code Expansion php5.2.0 Effective

Reference:

?
$url =$_get["url"];
if (strlen ($url >= ' 3 ')) {
Header ("Location:".) http://". $url);
}
?>
Implementation when the variable value character number is less than three bits, because the short domain name address such as G.cn also has three bits, so do not jump, you can display arbitrary content.

I hope the rookie can use, at least I am on the ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.