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 平板录音机录音问题解决
  • ¥15 请问维特智能的安卓APP在手机上存储传感器数据后,如何找到它的存储路径?
  • ¥15 (SQL语句|查询结果翻了4倍)
  • ¥15 Odoo17操作下面代码的模块时出现没有'读取'来访问
  • ¥50 .net core 并发调用接口问题
  • ¥15 网上各种方法试过了,pip还是无法使用
  • ¥15 用verilog实现tanh函数和softplus函数
  • ¥15 Hadoop集群部署启动Hadoop时碰到问题
  • ¥15 求京东批量付款能替代天诚
  • ¥15 slaris 系统断电后,重新开机后一直自动重启