PHP Equivalent to ServerVariables

They have: 82 posts

Joined: Oct 2001

OK guys,

I am an ASP guy who is moving over to the dark side!

I need PHP code that will get the user's browser type
and the URL they came from.

Thanks for your help!!

Mike

Blessed is the man who fears the LORD, who delights greatly in his commandments. Psalms 112:1

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

ASP is the dark side. Don't worry, your eyesight will adjust soon and you'll be able to see PHP in full colour glory, lol...

server variables

get browser

In general, php.net is a life saver.

They have: 238 posts

Joined: May 2002

Have a look at php documentation for more Server variables-
http://au3.php.net/manual/en/reserved.variables.php

Browser:

<?php
$_SERVER
[\"HTTP_USER_AGENT\"]
?>

Referer:
<?php
$_SERVER
[\"HTTP_REFERER\"]
?>

They have: 461 posts

Joined: Jul 2003

Quote: Originally posted by Suzanne
ASP is the dark side.

and it crawled out of the blackhole that is M$.
the problem with proprietary (sp?) software it's slower to adjust to security and other issues. the problem with M$ is that it's the worst of the proprietaries (sp?)

not only do they take the longest to respond to anything, their responses are rarely fixes. normally they just change HOW you bypass the security.

this is why you are not going to the dark side, ney you are turning away from the dark side young padawan. there is hope for you yet. a jedi you may become.

let me give you some pointers: first stop when you want to find something in php: http://www.php.net

first step when you want to find something on mysql (normal db used): http://www.mysql.com

first place to stop for help from other phpers (second for mysql help): http://forums.devnetwork.net

first place to stop for mysql help and second for php is here. (answers are just as good, but normally come much slower since there's not nearly as many...unless it';s a security thing. between the MIT PhD student and the Scott, the other place i mentioned is actually being used as testing grounds for security things...ie: a secure version of sessions or cookies is being developed by the MIT PhD student and he's asked the php dev net to oimplement it and report how it's working and he seems to be having a great deal of success with getting people to test it for him.... but on the sql side, they don't seem to have anyone nearly as efficient as Mark in giving not just a working response, but explaining it. the responses there to me have been along the lines of "i used this that a friend gave me, you might be able to modify it for your use... some sql code".. Mark on the other hand normally explains what's going on with it so you are sre to understand, so it's not just modifying what someone else used.)

i normally mirror any question on both boards. only recently have i noticed that anyone else is on both, and that's vincent who's new to the dev network

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.