php简单 在线投票系统 源码下载,上次要和你一家公合作他们说要我写一个简单的投票系统,但是每一个ip只能投一次,好了下面就是我写的一个最最简单的投票系统了,是用php实现的.
先来创建数据库.有两个一个记录投票次数与相关信息一个是记录ip.
create table if not exists `lj_vote` (
`id` int(8) not null auto_increment,
`v_type` int(4) default '1',
`v_caption` varchar(500) default null comment '此处可以放图片地址也可以是文章说明',
`v_hits` int(8) not null default '0' comment '投票次数',
`v_ip` text comment '投票ip为唯一,永远只有一次机会',
`v_name` varchar(50) default null comment '作品的作者',
`v_id` int(4) default null comment '唯一编号',
primary key (`id`)
) engine=innodb default charset=gb2312 auto_increment=21 ;
记录ip的数据库.
create table if not exists `lj_ip` (
`id` int(8) not null auto_increment,
`v_ip` varchar(50) default null,
`v_time` datetime default null,
primary key (`id`)
) engine=innodb default charset=gb2312 auto_increment=4 ;
嗯.好了数据都准备好了我们就来看php 是怎么实现投票的吧.
申明:本站原创转载请注明: www.111cn.net