Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

retrieving this info via php?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

retrieving this info via php?

Postby Godiwa » Mon Jun 16, 2003 4:49 pm

how do I retrieve this info via php so I can put it into my stat system that I already have running, I would like to know where people are coming from, so the referring url is what I need, and is there other info that I can pull too that might be useful when talking about stats?

Godiwa
Godiwa
New php-forum User
New php-forum User
 
Posts: 40
Joined: Wed Mar 05, 2003 5:55 am

Postby Joan Garnet » Tue Jun 17, 2003 1:09 am

You've got a couple of prdefined vars -->

Code: Select all
$browser = $_SERVER['HTTP_USER_AGENT'];
$language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby Godiwa » Tue Jun 17, 2003 4:39 am

thanks :)

is there any predefined that say the url they came from to get into my site?

Godiwa
Godiwa
New php-forum User
New php-forum User
 
Posts: 40
Joined: Wed Mar 05, 2003 5:55 am

Postby Joan Garnet » Tue Jun 17, 2003 10:06 am

Yes :)
Code: Select all
$_SERVER ["HTTP_REFERER"]


A good exercise to do is the following -->

Code: Select all
<?php
echo "<pre>";
print_r ($_SERVER);
echo "</pre>";
?>


Any time you need to use predefined variables such $_SERVER, $_ENV, $_COOKIE, $_GET, etc... just do that and you will see what you've got.

Bye!
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby Godiwa » Tue Jun 17, 2003 1:16 pm

cool thanks a lot, note written :o)

Godiwa
Godiwa
New php-forum User
New php-forum User
 
Posts: 40
Joined: Wed Mar 05, 2003 5:55 am


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.