早起一起突然看到,我的网站有人在恶心乱搞,为了防止这种事情我想了一个办法那就是封用户的IP了.首页我们来建数据库:
- CREATE TABLE `su_lockip` (
- `id` int(4) NOT NULL auto_increment,
- `lockip` varchar(1024) default NULL,
- PRIMARY KEY (`id`)
- )
下页来创建一个封文件的页面,主要是用户写入IP以"|"分开,这个页面就不多写了,我就简单的写一下,入库代码$UlockIp=$_POST['z']?$_POST['z']:'';
- if(emptyempty($UlockIp)){
- exit("<script>alert('对不起,你输入的信息有误!');history.back();</script>");
- }
- $sql="update su_lockip set lockip='$UlockIp'";
- if(mysql_query($sql)){
- exit("<script>alert('锁定成功!');history.back();</script>");
- }else{
- exit("<script>alert('对不起,你输入的信息有误!');history.back();</script>");
- }
就这么简单,最后就是进行锁定的了.下面代码是根据数据中是否存用户IP,如果在就提示被KILL了.代码如下:
- function lock_user_ip(){
- $Usql =mysql_query("select * from su_lockip");
- $Urs =mysql_fetch_array($Usql);
- $UlockIp=$Urs['lockip'];
- $ClockIp=$this->get_real_ip();
- $Iplist =explode('|',$UlockIp);
- if(in_array($ClockIp,$Iplist)){
- exit('sorry system lock your IP');
- }
- }
- function get_real_ip(){//这段代码来是互联网.
- $ip=false;
- if(!emptyempty($_SERVER["HTTP_CLIENT_IP"])){
- $ip = $_SERVER["HTTP_CLIENT_IP"];
- }
- if (!emptyempty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
- $ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
- if ($ip) { array_unshift($ips, $ip); $ip = FALSE; }
- for ($i = 0; $i < count($ips); $i++) {
- if (!eregi ("^(10|172.16|192.168).", $ips[$i])) {
- $ip = $ips[$i];
- break;
- }
- }
- }
- return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);
- }
哈哈写完了就这么简单,没有进行安全过滤处理.
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » php实现封IP功能
波比源码 » php实现封IP功能
levofloxacin 250mg canada levofloxacin order
dutasteride pills tamsulosin online order ondansetron 4mg uk
aldactone 100mg generic valtrex 1000mg pills fluconazole pills
buy ampicillin 500mg buy cephalexin 125mg pills erythromycin 250mg pill
fildena 50mg sale purchase methocarbamol online cheap order robaxin for sale
suhagra 50mg usa estrace 2mg oral estradiol 1mg drug
purchase lamictal online cheap purchase prazosin pill order retin gel online cheap
tadalafil 10mg sale purchase tadalis online cheap order diclofenac for sale
buy accutane 20mg for sale azithromycin 250mg us buy azithromycin online cheap
indocin 75mg pills order amoxicillin 500mg pills buy trimox generic
order tadalafil 5mg pill buy tadalafil 20mg viagra next day delivery usa
anastrozole 1 mg ca purchase anastrozole for sale sildenafil canada
cialis 5mg en france tadalafil 20mg pas cher acheter 25mg gГ©nГ©rique viagra en france
tadalafil 20mg kaufen ohne rezept tadalafil 10mg kaufen generika viagra 50mg kaufen
buy accutane 10mg buy azithromycin 250mg ivermectin human
generic modafinil 200mg provigil 200mg drug order acetazolamide online cheap
doxycycline us levitra cheap lasix us
ramipril 10mg without prescription purchase altace pills order azelastine 10 ml sale
order olmesartan 20mg pill brand olmesartan acetazolamide 250mg generic
order bupropion 150mg online cheap order strattera sale buy seroquel 100mg without prescription
order molnunat 200 mg generic buy cefdinir generic lansoprazole 15mg uk
order cialis 10mg pills amantadine 100mg usa oral symmetrel 100mg
revia 50 mg brand naltrexone 50 mg cost order abilify 30mg online
dapsone 100 mg price nifedipine 10mg pill order perindopril online cheap
oral provera 10mg order cyproheptadine 4mg without prescription buy periactin 4 mg online
modafinil brand order stromectol 3mg pills ivermectin 0.5%
order luvox generic brand cymbalta buy glipizide 10mg generic
cialis next day cialis oral purchase sildenafil without prescription
generic lasix buy lasix 100mg without prescription hydroxychloroquine over the counter
order tadalafil 5mg online generic betamethasone 20 gm clomipramine 50mg cost
order chloroquine 250mg pills buy chloroquine 250mg pills order baricitinib 2mg online cheap
order sporanox 100mg sale generic itraconazole 100mg tinidazole online
zyprexa 10mg drug bystolic 20mg tablet buy valsartan 80mg online
order norvasc 10mg generic buy amlodipine online cheap cialis price walmart
sildenafil 50mg oral lisinopril order online order lisinopril 10mg online cheap
buy generic omeprazole 20mg play great poker online casino arizona
order lopressor 100mg purchase vardenafil pill levitra 20mg brand
write essay for money play casino online blackjack vegas free online games
order clomid 50mg online cheap order clomid 50mg gamble poker online
cialis 20mg tablet buy cialis 40mg without prescription buy sildenafil 100mg sale
aristocort price order claritin 10mg brand clarinex 5mg
cheap generic tadalafil sildenafil for men over 50 viagra next day delivery
buy cialis 40mg online cheap order inderal 20mg pill order plavix online cheap
buy allopurinol for sale zetia uk zetia 10mg without prescription
cozaar 50mg drug cheap nexium 40mg order topiramate generic
order ozobax generic purchase lioresal online ketorolac brand
order flomax sale aldactone 25mg drug buy aldactone 25mg
tadalafil 40mg price ampicillin us ciprofloxacin ca
fluconazole 200mg cost generic fluconazole 100mg sildenafil 100mg tablets
genuine viagra order sildenafil tadalafil 40mg pill
order desyrel 50mg order suhagra 100mg order sildenafil 100mg generic
sildenafil dosage sildalis generic lamotrigine over the counter
buy generic deltasone 10mg accutane cheap cheap amoxicillin tablets
order azithromycin 500mg online cheap gabapentin 800mg gabapentin 100mg tablet
money games order stromectol for sale cheap modafinil
furosemide 100mg for sale buy plaquenil 200mg generic buy hydroxychloroquine 200mg
buy deltasone 5mg for sale cheap prednisone 40mg order generic mebendazole 100mg
retin cream over the counter avanafil 200mg us avanafil 200mg oral
generic tadalafil 10mg order generic voltaren 100mg indomethacin usa
buy terbinafine 250mg without prescription buy trimox 250mg pills cheap amoxicillin 500mg
order albuterol 100 mcg without prescription protonix brand ciprofloxacin 1000mg ca
montelukast 10mg cost cheap viagra online buy viagra
buy cialis 5mg pills cialis coupon tadalafil us
purchase ivermectin symmetrel 100mg price dapsone over the counter
cost adalat perindopril usa order allegra 120mg
ramipril price ramipril 10mg tablet buy etoricoxib 60mg without prescription
online assignment writer buy leflunomide 10mg sale order generic azulfidine
clobetasol cream buy clobetasol without prescription order amiodarone generic
buy generic diamox buy diamox pill azathioprine 50mg sale
buy digoxin 250 mg generic order telmisartan 20mg online cheap molnunat 200mg us
coreg 6.25mg uk carvedilol 6.25mg us elavil 10mg us
buy pamelor 25mg generic paroxetine generic buy paxil sale
indomethacin 50mg tablet flomax 0.4mg usa cenforce 100mg pills
ropinirole without prescription calcitriol 0.25 mg brand trandate online order
esomeprazole 40mg ca biaxin 250mg price order lasix 40mg pills
minocin drug order minocycline 50mg online buy hytrin 5mg pill
modafinil 100mg pills provigil 100mg price purchase phenergan online cheap
brand deltasone 40mg order isotretinoin 40mg without prescription order generic amoxil 500mg
buy fildena 100mg order pregabalin 150mg online order propecia 1mg pill
buy zofran for sale order ondansetron pills bactrim 480mg ca
buy ventolin 4mg without prescription buy generic clavulanate purchase augmentin pill