Connect to an external website with PHP

一曲冷凌霜 提交于 2019-12-08 05:02:31

问题


Let say i have a website (called s1.com..?) with a login form. After you succesfully log on the website, you have a page with some status infos like : Ticket Closed. since... And then ai have a page, on another server that need to go on s1.com, log me in and then retreive the date if the ticket is closed...

I dont really need all of the script since i think i can figure it out, but i wonder how do i make the first part, connecting the webpage onto the s1.com webpage so ill be able to fetch data?

Thanks for any help guys!


回答1:


You can use either curl (link has an example) or fopen (see the examples section).

Note that using fopen requires that the allow_url_fopen setting to be enabled, while curl requires the curl module to be enabled.




回答2:


I think You can also Use JSONP with jQuery, this is alternative of CURL ( i may b wrong ) here is some useful links

  • First Link
  • Second Link
  • Third Link


来源:https://stackoverflow.com/questions/4882218/connect-to-an-external-website-with-php

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