让PHP登录某个地方(POST用户名和密码),然后获取cookie [英] Getting PHP to login somewhere (POST username and password) and then get the cookies

查看:292
本文介绍了让PHP登录某个地方(POST用户名和密码),然后获取cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我需要一个应用程序来获取一些数据但是为了访问该页面,您必须登录(cookies)。我首先需要我的PHP登录,获取cookie,然后使用它们来获取我需要的页面吗?


有什么建议吗?

提前致谢

Hi

I need an application to get some data but in order to access that page, you must be logged in (cookies). I need my PHP to login first, get the cookies and then use them to get the page i need?

Any suggestions?
Thanks in advance

推荐答案

嗨。


查看 cUrl函数。他们应该有这个能力。
Hi.

Check out the cUrl Functions. They should be capable of this.


感谢您的建议。我已经完成了应该做的事情并且遇到了问题


基本上,MS Server提供HTTP 400错误:
Thanks for the advice. I have done what should be done and i''ve run into problems

Basically, the MS Server is giving HTTP 400 error:
展开 | 选择 | Wrap | 行号


网站可能会受到这种保护。


错误400通常在请求时发送格式错误或损坏。可能是你错过了一些标题或者你的请求是否以其他方式不完整?


你能告诉我们代码吗?


PS请编辑任何真实的网址。最好不要在公共论坛上发布实时网址,实际上我们的发布指南
It is possible that the website is protected against this sort of thing.

Error 400 is usually sent when a request is badly formatted or corrupted. Could it be that you are missing some header or that your request is incomplete in some other way?

Could you perhaps show us the code?

P.S. Please edit out any real URL''s. It is best all around not to post live URL''s in public forums, and it is in fact forbidden by our Posting Guidelines.


这篇关于让PHP登录某个地方(POST用户名和密码),然后获取cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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