0

I'm wondering how I can use file_get_contents to load an external page and exit off before the page loads (I don't need the output). Here's the essential flow:

  • A: POST request with file_get_contents to B

  • B: ignore_user_abort(true); and does a very long action

  • A: finishes right after it makes the connection to B

  • B: finishes after the very long action

How would I go about "exiting" right when script B starts executing (before the page loads)

Josh
  • 83
  • 10
  • However you do it, you would do the same as if you ask for a single file. So please reduce your question to the needed minimum and then search for it, I have the feeling you'er not the first one asking for it. Right now it's not clear about which part in your question you actually wonder about. – hakre Aug 24 '13 at 06:12
  • Ah sorry, the exit before page loads part. – Josh Aug 24 '13 at 07:01
  • Okay, I can see my comment was a bit biased, the duplicate question I've reviewed so far here on site are concerned about browser requests. As you do a request with `file_get_contents` the question would be *if* that does as well work with PHP's http wrappers. First of all I would say "Why not?" and then try it out my own if I were you. Example duplicate questions are #138374 and #3270414 but those are actually only two I did review and in the search results I have seen even a few more promising titles. – hakre Aug 24 '13 at 07:07
  • I guess as there is no further feedback, it's a somewhat safe bet to choose an early duplicate to hold against until more differentiating and specific information about a new problem arises. – hakre Aug 24 '13 at 07:44
  • Yeah sorry about that, I was searching for a duplicate for a while before posting this and couldn't find one. That's it though, thanks. – Josh Aug 24 '13 at 20:39
  • well if that fully answers your question, I'm lucky I could point it to you then. If this does not work with `file_get_contents` please leave a comment and edit the question a little to make clear what the differences to the duplicate are. – hakre Aug 24 '13 at 21:04

0 Answers0