高级cURL和PHP [英] Advanced cURL and PHP

查看:160
本文介绍了高级cURL和PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在几个小时前做了一个类似的问题,但我想我问了一个错误的问题。这是更精确的一个。

I made a similar question few hours ago, but I think I asked a wrong question there. This is more exact one.

im使用cURL PHP和我想使用一个网站,但每次我改变我的网站,浏览器发布一个值 x 到服务器,如果你不,你不能去网站。

im using cURL on PHP and i want to use a site, but everytime i change my site, the browser posts a value x to server, and if you dont, you can't go to the site.

你可以看到x值从图片,它的一个FireFox Live HTTP标头插件,它显示我用浏览器访问的网页

you can see that the x value changes all the time from the picture, its a FireFox Live HTTP headers addon, it shows what pages i visit with browser

我看了源代码,发现什么是x值,它来自javascript。我可以从服务器获取cURL或其他方式的值吗?

i looked the source code and found out what is the x value, and it comes from javascript. can i get the value with cURL or some other way from the server?

date = new Date();
    ms = (date.getHours() * 24 * 60 * 1000) + (date.getMinutes() * 60 * 1000) + (date.getSeconds() * 1000) + date.getMilliseconds();

所以主要的问题是x值会一直变化,完全正确的值,甚至毫秒必须是正确的。我尝试用javascript自己找到值,然后把它放到php,但仍然不工作

推荐答案

javascript正在做的是计算客户端上的当前时间(毫秒)并将其发送到服务器。你可以使用 $ ms = time()* 1000;

All that javascript is doing is calculating the current time in milliseconds on the client and sending it to the server. You can calculate such a time in php trivially with $ms = time() * 1000;

这篇关于高级cURL和PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆