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 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c