Home > php教程 > php手册 > body text

php强制运行广告的代码

WBOY
Release: 2016-05-26 08:21:17
Original
1443 people have browsed it

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

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

<?php 
	session_start();  
	$lifeTime = 24 * 3600;  
	session_set_cookie_params($lifeTime);  
	$i = $_SESSION[&#39;vv&#39;]=$_SESSION[&#39;vv&#39;]+1; 
	//开源代码phprm.com 
	if ($i < 2): 
	 
	您的弹跳窗代码    
	 
	<?php endif;  
Copy after login

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

教程地址:

欢迎转载!但请带上文章地址^^

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!