User-Agent Behind Opera Mini

Started on the old forum in August 2009 · view the original in the archive · old links redirect here

11 replies · 2,231 views · started 17 years ago · 1 min read

9 participants
CreativityKills Lead · 833 posts #1

Blah blah, might be useful.

function userAgnt(){
$str = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
 if(stristr('Opera Mini',$str)){
 $str = isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) ? $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] : '';
 }
return mysql_real_escape_string($str);
}
anderson Developer · 146 posts #2

What the usefulness of this script?

Wait...

something else Fellow · 2,296 posts #3

To tell you what phone they are using behind opera mini*

anderson Developer · 146 posts #4

mobilegigs wrote: blah blah, might be useful.

function useragnt(){
$str = isset($_server['http_user_agent']) ? $_server['http_user_agent'] : '';
 if(stristr('opera mini',$str)){
 $str = isset($_server['http_x_operamini_phone_ua']) ? $_server['http_x_operamini_phone_ua'] : '';
 }
return mysql_real_escape_string($str);
}

not working

Wait...

malaysiawap Junior · 14 posts #5

maybe helpfull

echo browser_agent($_SERVER["HTTP_USER_AGENT"]);

function browser_agent($_mob_browser){
if(preg_match('/(google|bot)/i',strtolower($_mob_browser))){
$position = strpos(strtolower($_mob_browser),"bot");
$_mob_browser = substr($_mob_browser, $position-30, $position+2);
$_browser = explode (" ", $_mob_browser);
$_browser = array_reverse($_browser); 
}else if (isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])) {
$_mob_browser = $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'];
$_position=strpos(strtolower($_mob_browser),"nokia");
if($_position)$_mob_browser = substr($_mob_browser, $_position,25);
$_browser = explode ("/", $_mob_browser);
}else {
$_position=strpos(strtolower($_mob_browser),"nokia");
if($_position)$_mob_browser = substr($_mob_browser, $_position,25);
$_browser = explode ("/", $_mob_browser);
}
return $_browser[0];
}
anderson Developer · 146 posts #6

malaysiawap wrote: maybe helpfull

echo browser_agent($_SERVER["HTTP_USER_AGENT"]);

function browser_agent($_mob_browser){
if(preg_match('/(google|bot)/i',strtolower($_mob_browser))){
$position = strpos(strtolower($_mob_browser),"bot");
$_mob_browser = substr($_mob_browser, $position-30, $position+2);
$_browser = explode (" ", $_mob_browser);
$_browser = array_reverse($_browser); 
}else if (isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])) {
$_mob_browser = $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'];
$_position=strpos(strtolower($_mob_browser),"nokia");
if($_position)$_mob_browser = substr($_mob_browser, $_position,25);
$_browser = explode ("/", $_mob_browser);
}else {
$_position=strpos(strtolower($_mob_browser),"nokia");
if($_position)$_mob_browser = substr($_mob_browser, $_position,25);
$_browser = explode ("/", $_mob_browser);
}
return $_browser[0];
}

yes. this is workable. it was posted here first by gumslone very ago. thanks.

Wait...

wap2k Developer · 168 posts #7

more usefull but well know headers

x-operamini-features:

Header added by the Opera Mini proxy. Values are "advanced, download, camera, folding, inputhints"

x-operamini-phone:

The phone name provided by the Opera Mini proxy.

x-operamini-phone-ua:

The original user-agent of the device using a Opera Mini browser

x-original-user-agent:

Googles transcoders way to pass the device' user agent to the server.

doriann Developer · 94 posts #8

Tankyou malasyawap for your code. This code workable. More im the problem using this code. What acess usingned the browser real my (sony ericsson w610i) not apear in agente. What code im use to cocert this?

DoRiAnN DaMoN

coder programmer http://www.plugadoz.net

12345xmen Developer · 239 posts #9

Where i put this code plz tel me.

12345xmen Developer · 239 posts #10

In which file i put this code plz tel me.

Leviathan73 Senior · 260 posts #11

in which file should put the code on index.php?

kabooms Developer · 80 posts #12

mobileGIGS wrote: Blah blah, might be useful.

function userAgnt(){
$str = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
 if(stristr('Opera Mini',$str)){
 $str = isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) ? $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] : '';
 }
return mysql_real_escape_string($str);
}

this code goes to core.php create database in user table to store the out put of the code and create a usage in login.php or index.php to update user in his/her real browser behind operamini .Just a idea.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close