Send Operamini headers using CURL

Web hosting, SEO, etc... related
Post Reply
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Send Operamini headers using CURL

Post by Rksk » Sun Apr 03, 2011 9:49 am

When a visitor comes to my site, PHP $_SERVER variable sets some data like below.

Code: Select all

$_SERVER['HTTP_USER_AGENT']=Opera/9.80 (J2ME/MIDP; Opera Mini/4.2.14912/22.414; U; en) Presto/2.5.25 Version/10.54
$_SERVER['HTTP_X_FORWARDED_FOR']=202.129.235.12
$_SERVER['HTTP_X_OPERAMINI_FEATURES']=advanced, file_system, folding
$_SERVER['HTTP_X_OPERAMINI_PHONE']=Nokia # E71
$_SERVER['HTTP_X_OPERAMINI_PHONE_UA']=Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaE71-1/300.21.012; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
Can anyone help me to send these data using PHP CURL?
Because I have wanted to use CURL as a Operamini browser.

Thank you.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Send Operamini headers using CURL

Post by Neo » Mon Apr 04, 2011 11:23 am

I don't understand the question. Can you explain it a bit more. Where do you want to send these data? Is it to a database or do you need to call another url with these data?
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: Send Operamini headers using CURL

Post by Rksk » Mon Apr 04, 2011 11:42 am

I want to call a url sending these data.

[ Post made via Mobile Device ] Image
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Send Operamini headers using CURL

Post by Neo » Mon Apr 04, 2011 12:02 pm

Lots of curl help here on the forum. If you have used search, you would have found those.

How to use cURL using php
How to do a http request using php

Hope those help!
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: Send Operamini headers using CURL

Post by Rksk » Mon Apr 04, 2011 2:15 pm

Neo wrote:Lots of curl help here on the forum. If you have used search, you would have found those.

How to use cURL using php
How to do a http request using php

Hope those help!
I have basic knowladge friend,
Also I can set HTTP_USER_AGENT using curl_setopt($ch, CURLOPT_USERAGENT, $UserAgent);
But the problem is can't set REMOTE_ADDR, HTTP_X_FORWARDED_FOR,....

Thank you.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Send Operamini headers using CURL

Post by Neo » Mon Apr 04, 2011 3:12 pm

But the problem is can't set REMOTE_ADDR, HTTP_X_FORWARDED_FOR,....
Both these are automatically set by the client when connecting to a server. Say you connect to ROBOT.LK from your PC. So the REMOTE_ADDR is your WAN IP address. You can't change that according to my knowledge. You can change the user agent (browser) but not the client IP address.
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: Send Operamini headers using CURL

Post by Rksk » Mon Apr 04, 2011 4:12 pm

What about others in the 1st post?

[ Post made via Mobile Device ] Image
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Send Operamini headers using CURL

Post by Neo » Mon Apr 04, 2011 10:05 pm

Try to pass Opera specific headers using CURLOPT_HTTPHEADER.
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: Send Operamini headers using CURL

Post by Rksk » Tue Apr 05, 2011 11:07 am

It was the answer for my problem.

Thank you neo.

[ Post made via Mobile Device ] Image
Post Reply

Return to “Web Related”