Jump to content

file_get_contents() using cookie information


springo

Recommended Posts

But that sets a cookie on the user's PC and file_get_contents() requests a file that needs to read the cookie on the server (yes, it's on another domain).

 

OK but your question was

 

Hi,

I look forward to parsing a dynamic page which requires cookie info to display properly.

Is it possible to send cookie info so that file_get_contents() reads the proper page?

Thank you for your help.

 

so

Step #1

set the cookie,

 

Step #2

use file_get_contents() "to parsing a dynamic page which requires cookie info to display properly"

 

as its on another domain, that domain will have to create the cookie,

OK let me explain it more clearly:

1- Hosting located in Spain runs my script which calls file_get_contents() to parse a website

2- Parsed website finds no cookie specifying a language on my host, so it creates one according to IP (so cookie will say "Spanish")

3- Returned contents are in Spanish so my parsing script won't work

 

So basically what I need is a customized cookie saying "English", so that when I try to file_get_contents(), the parsed website returns contents in English.

 

Thank you and sorry if I don't make myself clear enough.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.