What does REQUEST_TIME mean in PHP?

匿名 (未验证) 提交于 2019-12-03 08:30:34

问题:

Is it the time when I click the send button on my HTML form, or the time when it arrives to the server?

<?php echo $_SERVER['REQUEST_TIME']; ?> 

Edit:

I have already read the manual, Googled other sources - including SO. The clearest definition I've found is still ambigous to me, as I don't know what the start of the request means exactly in the definition below.

'REQUEST_TIME'

The timestamp of the start of the request. Available since PHP 5.1.0.

http://php.net/manual/en/reserved.variables.server.php

It could mean the moment when the request leaves the client, or the moment when it arrives to the server. It is not always the same, especially if the network speed is low and the latency is high.

Edit 2:

This is not a "just because" type of question. I need to maintain a food ordering service, and people with poor internet often have problems: sometimes they think we get the order when we don't, other times they think we don't get it when we do. So I've set an XHR timeout, to inform the user that the request took too much time so she should try again. But the timeout happens only on client side: the request still arrives to the server. So the server needs to know the time of the sending, not the receiving, so that it can be sure it's not a timed out request that should be discarded.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!