dsf5632 2015-10-20 03:49
浏览 38
已采纳

浏览器在没有输入的情况下运行PHP脚本吗

I have a PHP script that I run to update a database of mine - it is held on a remote webserver, so I make changes to that PHP script and then run it to dump the results into the database. It works fine - except I have been noticing that the PHP script is running when I don't want it to.

That is - when I DO NOT type in the URL with the specific GET variables required for it to work, the script seems to be running anyways. So my question is do browsers request URLs without me asking them to?

The problem is the script takes a very long time to run and it seems when the requests (from some other source) are run that it doesn't complete - which leaves my database only partially full and effectively useless. What I have noticed, however, is that it is only the one set of tables from a specific request that I have been running that are getting "randomly" run.

EDIT: I have a script that requires multiple variables be passed to it through GET. I will run it at one point in the day (say 2pm) it takes a very long time to complete, almost 2 hours. It completes fine and all is good. Then a few hours later, WITH NO INPUT FROM ME, it runs again - with the exact same variables passed to it but does not complete.

My suspicion is that my browser is re-requesting the URL for some reason, or Google is or something, I'm just looking to see if anyone has any idea what could be causing this.

EDIT 2: Realized I'm an idiot. What's happening is my computer goes to sleep and when it wakes up the browser refreshes instead of using the stale data.

  • 写回答

1条回答 默认 最新

  • dongmiao260399 2015-10-20 04:10
    关注

    They are run without input on a browser if you:

    1. include javascript timeout to refresh/reload the page
    2. basically write code inside the script to call itself whether one time, a few times, or at intervals
    3. your browser is not "normal", due to whatever reason
    4. a malware on you machine grabs the url from the browser and forces the browser to call it again and again
    5. etc
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

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