Browser Info

Started on the old forum in July 2006 · view the original in the archive · old links redirect here

23 replies · 2,906 views · started 20 years ago · 1 min read

2 participants
--Mike-- #1

Can someone please tell me how on earth I can change the the browser info to, example Opera or Nokia or Samsung and not the configuration. Only the browser type. External image (may be gone)

Attachments: user.php
abhisar #2

what do you exactly want to say.

--Mike-- #4

Yes exactly like that, and for another example Samsung D500 blah blah blah only SAMSUNG D500

CLINT #6

lol, some people really do go round the houses!! Try this

$browser = explode ('/', $HTTP_USER_AGENT);
echo $browser[0];

This will give you the result you want. (and how much neater is this one, lol)

Charles #7

lol, some people really do go round the houses!! Try this

$browser = explode ('/', $HTTP_USER_AGENT);
echo $browser[0];

This will give you the result you want. (and how much neater is this one, lol)

LMAO Allready gave Mike the code and its working! External image (may be gone)k:

naveen-PHP LEARNER #8

Ha ha.... i really didnt know dat mate...i took a long cut... Mike ... try the clints one instead of mine.... External image (may be gone)

abhisar #9

I use that on my site and its good.

Guest #10

how can i get it to show eg. Samsung D600 instead of SAMSUNG-SGH-D600? but with all phones?

lamar-wap #11

here bro...........

displays eg opera 8.54/

print 'Browser:';
$browser = explode ('/', $HTTP_USER_AGENT);
print $browser[0];
print '
';
print "IP:
$REMOTE_ADDR
\n";

displays eg only opera

echo "
Browser:
";
echo "$HTTP_USER_AGENT
";
echo "Ip:
";
echo "$REMOTE_ADDR";
raju4u #12

Can someone please tell me how on earth I can change the the browser info to, example Opera or Nokia or Samsung and not the configuration. Only the browser type. External image (may be gone)

hi mike how r u

hi mike how r u

where u form plz

here bro...........

displays eg opera 8.54/

print 'Browser:';
$browser = explode ('/', $HTTP_USER_AGENT);
print $browser[0];
print '
';
print "IP:
$REMOTE_ADDR
\n";

displays eg only opera

echo "
Browser:
";
echo "$HTTP_USER_AGENT
";
echo "Ip:
";
echo "$REMOTE_ADDR";

hi mike how r u where u form plz

hi every body how r u , u are wel come

hardstyle Developer · 154 posts #13

well for me i would rather choose for instance Opera 9.0 over only Opera cause if you browser ban you will ban everyone using Opera, but if you only ban Opera 9.0 then its quite obious

makes browser ban more accurate

8th wonder of the world

abhisar #14

yes or indeed the full thing with operating system details in it.It will be better.

Tommy-T Developer · 56 posts #15

lol, some people really do go round the houses!! Try this

$browser = explode ('/', $HTTP_USER_AGENT);
echo $browser[0];

This will give you the result you want. (and how much neater is this one, lol)

this one dont work for me more.. it shows nothing

Guest #16

this one dont work for me more.. it shows nothing

Works fine with me U better try the long method then

Guest #17

this one dont work for me more.. it shows nothing

did u make sure it was within the <?php ?> tags?? i know it seems like a dumb question, but ive been fooled by this simple mistake many times lol

Thank_You_Bot #18

<#thank#>

Guest #19

I always use

$browser = $_SERVER['HTTP_USER_AGENT'];

I find it more reliable than the explode method.

Guest #20

here is my code which i use

                        print 'Your Info:';
                        $browser = $_SERVER['HTTP_USER_AGENT'];
                        print '

'; print "IP: $REMOTE_ADDR \n"; echo "Browser: $browser";

even i prefer $browser = $_SERVER['HTTP_USER_AGENT']; External image (may be gone)

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