Page 1 of 1

Send Operamini headers using CURL

Posted: Sun Apr 03, 2011 9:49 am
by Rksk
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.

Re: Send Operamini headers using CURL

Posted: Mon Apr 04, 2011 11:23 am
by Neo
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?

Re: Send Operamini headers using CURL

Posted: Mon Apr 04, 2011 11:42 am
by Rksk
I want to call a url sending these data.

[ Post made via Mobile Device ] Image

Re: Send Operamini headers using CURL

Posted: Mon Apr 04, 2011 12:02 pm
by Neo
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!

Re: Send Operamini headers using CURL

Posted: Mon Apr 04, 2011 2:15 pm
by Rksk
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.

Re: Send Operamini headers using CURL

Posted: Mon Apr 04, 2011 3:12 pm
by Neo
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.

Re: Send Operamini headers using CURL

Posted: Mon Apr 04, 2011 4:12 pm
by Rksk
What about others in the 1st post?

[ Post made via Mobile Device ] Image

Re: Send Operamini headers using CURL

Posted: Mon Apr 04, 2011 10:05 pm
by Neo
Try to pass Opera specific headers using CURLOPT_HTTPHEADER.

Re: Send Operamini headers using CURL

Posted: Tue Apr 05, 2011 11:07 am
by Rksk
It was the answer for my problem.

Thank you neo.

[ Post made via Mobile Device ] Image