php+mysql implements advertising click statistics (with code)

Lisa Kudrow
Release: 2023-03-26 16:14:02
Original
2224 people have browsed it

This time I will bring you php mysql to implement advertising click statistics (with code). What are the precautions for php mysql to implement advertising click statistics? The following is a practical case, let's take a look.

php Advertising click statistics code. Last night, several IDC websites wanted to cooperate with this site to put some advertisements, but I wanted to see the advertising effect, so I thought about it and wrote a simple advertising statistics code, here Just waiting for the statistics cannot be IP restrictions or disgusting clicks, etc.

First comeCreate the database.

CREATE TABLE IF NOT EXISTS `ad_count` ( `ad_id` int(8) NOT NULL auto_increment, `ad_hit` int(8) NOT NULL default '0', `ad_name` varchar(200) character set gb2312 default NULL, `ad_datetime` datetime default NULL, `ad_qq` varchar(15) character set gb2312 default NULL, `ad_url` varchar(900) character set gb2312 NOT NULL, `ad_price` int(8) NOT NULL, PRIMARY KEY (`ad_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
Copy after login

After the data is created, we start writing the program. I won’t write the data connection anymore,

',$Str); $temp =str_replace('<','<',$Str); $temp =str_replace('>','>',$Str); $temp =addslashes($Str); return $temp; } function get_value($value,$para){ return htmltohtml(empty($para)?(isset($_GET[$value])?$_GET[$value]:''):(isset($_POST[$value])?$_POST[$value]:'')); }
Copy after login

Then we will write as follows where we want to display the advertisement.

Copy after login

That’s it

I believe you have mastered it after reading the case in this article For more exciting methods, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Detailed explanation of the steps for php to crawl Tmall and Taobao product data (with code)

php recursion Detailed explanation of function case usage

The above is the detailed content of php+mysql implements advertising click statistics (with code). For more information, please follow other related articles on the PHP Chinese website!

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
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!