Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.