Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: defaultpage of website

by wolfi (Scribe)
on Mar 16, 2004 at 06:05 UTC ( [id://336941]=note: print w/replies, xml ) Need Help??


in reply to defaultpage of website

i confess, i've never used LWP... but i do work around webdev and i can't figure out, what you're trying to do.

lemme explain...
A) many developers (who have a site) capture info from users - like 'user agents' (browsers, spiders/bots, etc), http-referers (to tell'em where the visitor is coming from), etc... if you're trying to get this info from a site you don't own or work on - it begs the question... why?

unless of course, you're trying to hack it (in which case, i won't be answering that Q).

B) regarding default pages - this is done in configuration files on the server. The administrator can put whatever they wish as the default. And if the site is dynamically generated (via a script - like perl), uses frames, redirection, etc... as anonymous monk above me said, it's quite possible the visitor may not know. (And if you're trying to get into someone's config file, ya might wanna have an attorney on retainer.)

you could always glance at the html's source code... that might give an indication - but that isn't guaranteed, since the server can redirect someone at its whim. You can ask for page X and the server might decide to give you page Y. It's the server's choice - it's THEIR files.

C) To try to get this back to perl, however... Assuming you're not nefarious and are running a server yourself - trying to get info from your visitors, there's a very easy way to do this -> Just use environmental variables.

my $item1 = $ENV{PATH_INFO} my $item2 = $ENV{PATH_TRANSLATED} my $item3 = $ENV{HTTP_USER_AGENT} my $item4 = $ENV{HTTP_REFERER} etc...

i'm not gonna list all the possible @ENV out there, but any html/cgi book should have'em listed. (We'll plug the CGI Programming with Perl by O'Reilly) Do note, however, that these variables are dependent upon the visitor's platform (browser, etc) and its configuration. One can't rely on this info completely, but it isn't bad for broad-based statisical info.

Replies are listed 'Best First'.
Re^2: defaultpage of website
by Aristotle (Chancellor) on Mar 16, 2004 at 14:25 UTC
    He's trying to get information about servers, not information about the visitors of these servers.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://336941]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-23 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found