How php forces advertising

Source: Internet
Author: User
This article mainly introduces php's method of forcibly running advertisements. It is a very practical technique to use session to record visitor visits and call pop-up window advertisements to increase advertising revenue, for more information, see

This article mainly introduces php's method of forcibly running advertisements. It is a very practical technique to use session to record visitor visits and call pop-up window advertisements to increase advertising revenue, for more information, see

This article describes how php enforces advertising. Share it with you for your reference. The specific implementation method is as follows:

Website traffic is high, but visitors just don't need to click, which makes it difficult for the webmaster who wants to make money. But there is such a good function in php: session. The idea is like this, use session to save the ip address of each visitor.

In this way, after one access, the advertisement will not be adjusted, so it will be fantastic and will not jump into the advertisement. Second, you can increase your income. The Code is as follows:

The Code is as follows:

<? Php
Session_start ();
$ LifeTime = 24*3600;
Session_set_cookie_params ($ lifeTime );
$ I = $ _ SESSION ['vv '] = $ _ SESSION ['vv'] + 1;
If ($ I <2 ){
// Add your pop-up code here
}
?>


Note: Only advertisements with pop-up windows can be implemented.

I hope this article will help you with PHP programming.

,

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.