Home > Backend Development > PHP Tutorial > php强制运行广告的方法_php技巧

php强制运行广告的方法_php技巧

WBOY
Release: 2016-05-16 20:29:34
Original
1376 people have browsed it

本文实例讲述了php强制运行广告的方法。分享给大家供大家参考。具体实现方法如下:

网站流量大但是访客就是不要点击,着让我们想赚钱的站长苦恼不以,但是在php中有这么一个很好的函数就是:session,思路是这样的,用session来保存每一个访问者的ip.

这样访问一次后就不调广告了,这样就全奇美了,不会乱跳广告,二又可以增加收入,代码如下:

复制代码 代码如下:
session_start(); 
$lifeTime = 24 * 3600; 
session_set_cookie_params($lifeTime); 
$i = $_SESSION['vv']=$_SESSION['vv']+1;
if ($i //此处加入你的弹窗代码
}
?>

注意:必须要是弹窗的广告才能现实.

希望本文所述对大家的PHP程序设计有所帮助。

Related labels:
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