博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【PHP开发篇】一个统计客户端商机提交的获取IP地址
阅读量:6964 次
发布时间:2019-06-27

本文共 1165 字,大约阅读时间需要 3 分钟。

1.对客服提交数据的ip地址记录。

获取ip地址的方法:

public function getIP()         {             global $ip;             if (getenv("HTTP_X_REAL_IP"))             $ip = getenv("HTTP_X_REAL_IP");            else if (getenv("HTTP_CLIENT_IP"))             $ip = getenv("HTTP_CLIENT_IP");             else if(getenv("HTTP_X_FORWARDED_FOR"))             $ip = getenv("HTTP_X_FORWARDED_FOR");             else if(getenv("REMOTE_ADDR"))             $ip = getenv("REMOTE_ADDR");             else             $ip = "Unknow";             return $ip;        }

 

ajax提交的请求处理function

1     /* 2      * ajax提交商机信息 3      */ 4     public function ajaxPushAction(){ 5         $this->getRequest()->isPost() && $this->post = $this->getRequest()->getPost(); 6         if(!$this->post['t_name'] || !$this->post['t_tel']){ 7             $res = -1; 8             Comm_Tools::renderJson($res); 9         }10         $getip = $this->getIP();11         $this->post['getip'] = $getip;12         $url = "http://home.demo.cn/web/buss/ajaxPushBusinessToQueue";13         $res = Comm_Tools::curl($url, 'POST', $this->post);14         Comm_Tools::renderJson($res);15     }

 

转载于:https://www.cnblogs.com/patf/p/5419907.html

你可能感兴趣的文章
JSON TO NSDictionary Mac & iOS
查看>>
成长计划
查看>>
opencv工具类小集
查看>>
foobox 4.2(foobar2000 CUI配置)
查看>>
django日志写入文件
查看>>
hana system replication
查看>>
Android MediaPlayer的生命周期
查看>>
shell中的函数、数组、告警系统分析
查看>>
关于我们
查看>>
jQuery之input
查看>>
下载文件 利用NSURLSession下载文件
查看>>
正则表达式(grep,egrep,fgrep)
查看>>
hadoop-namenode启动过程及坏块处理流程
查看>>
Java虚拟机学习 - 对象引用强度
查看>>
shell 检查文件是否被串改
查看>>
linux文件共享
查看>>
TEC-003-sqlmap安装及使用
查看>>
CentOS6.4_X86_64 安装Drupal-7.31必须成功版!
查看>>
mybatis 调用存储过程,如何抛出sql异常
查看>>
SUN Zone Cluster安装及配置说明之一
查看>>