duanche4578 2010-11-30 15:51
浏览 63
已采纳

当我们使用我们自己的localhost服务器与google的搜索API进行通信时,php中的curl_setopt中referer的值应该是多少?

what should be the value of referer in curl_setopt in php when we are communicating with the google's search api with our own localhost server? curl_setopt($ch, CURLOPT_REFERER, $referer); usually we are placing our sitename as 3'rd parameter.But what we want to put when we are running this in our local server? im using apche in ubuntu.

  • 写回答

1条回答 默认 最新

  • 普通网友 2010-11-30 15:54
    关注

    Why do you even care about referrer? This is totally unnecessary to set any value. The only valid reason to set referrer is when you know that program requires it and will not work without a valid referrer. The other reason people set referrer in curl is when they want to scrape web page or do other sneaky things where they trying to hide the fact that they are not accessing the page with a regular browser.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献