douhuzhi0907 2011-05-13 14:44
浏览 69
已采纳

php自动每日http登录请求

I need to recover XML data from a news provider for a website. In order to do so, I need to send a url request to authenticate on a daily basis, and then I need to include the authentication ID with every new request I send. Basically the session expires every 24 hrs and then I need to request a new one to keep receiving my (non-RSS) news feeds. Is there any way to automate this process? With cURL maybe? My knowledge of PHP is fairly basic but I don't imagine I need to manually go into the file every morning, request the ID and copy the numerical string into all of my data requests...? Also I don't know if this is common practice or if it is specific to our news provider, but any help, or if someone could maybe point me to a PHP tutorial on how to do this would be appreciated.

Thanks! Jane

  • 写回答

1条回答 默认 最新

  • dphfwzn8269 2011-05-13 14:52
    关注

    You can createe your php file to tdo the job then use either:

    Windows SCheduler to perform the job at a specific time

    or

    Cron job to do the same thing in a unix based system,

    I hope this is what you are looking for

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

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制