How to add a link to the ads in Baidu paste Image _php Tutorial

Source: Internet
Author: User
Help the Home (www.Bkjia.com) tutorial today in Baidu Bar see a post, click inside the picture will enter their own set of good links. Seems unlikely, because Baidu only allows you to fill in a picture link, do not allow the image to add links. In fact, through PHP to determine whether the image is referenced, or in the view is good, the code is as follows:

The following is the referenced content:
$fileLine = File (dirname (__file__). "/file.ini");
$nameMap = Array ();
foreach ($fileLine as $item) {
$item = Explode ("", $item);
if (count ($item) = = 3) {
$nameMap [$item [0]] = Array ($item [1], $item [2]);
}
}

$name = $_get[' name '];
if (!isset ($nameMap [$name])) {
Exit (0);
}
Header ("Cache-control:no-cache, must-revalidate"); http/1.1
Header ("Expires:sat, Jul 1997 05:00:00 GMT"); Date in the past
if (Isset ($_server[' http_referer ')) && stripos ($_server[' http_referer '], "Baidu")!== false) {
Header ("Content-type:image/png");
Echo Get ($nameMap [$name][0]);
} else {
Header ("Location:".) $nameMap [$name][1]);
Exit (0);
}

File.ini This configuration:

The following is the referenced content:
Mysql.jpg Http://www.bkjia.com/bkjia.com/images/liehuo2009/logo.gif http://www.bkjia.com/
Lyf.jpg http://www.bkjia.com/uploads/allimg/090904/1231133495-0-lp.jpg http://www.bkjia.com/

Call this call:

Http://yourhost/image.php?name=lyf.jpg

This image will be able to achieve the function of the bar. Very simple, but very creative. However, this method can not be under Firefox!

http://www.bkjia.com/PHPjc/364323.html www.bkjia.com true http://www.bkjia.com/PHPjc/364323.html techarticle Fire Network (liehuo.net) tutorial today in Baidu Bar see a post, click inside the picture will enter their own set of good links. It seems unlikely, because Baidu only allows you to fill in ...

  • 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.