Avatar billede clinton-2 Nybegynder
29. november 2001 - 17:45 Der er 6 kommentarer og
1 løsning

bestemmelse af browser, browser version.

Er det muligt at få clientens browseroplysninger med perl script?
Og I så fald, hvor kommer oplysningerne fra?
Er det registringsdatabasen (hvilken key) eller hvad?
Avatar billede flyhigh Nybegynder
29. november 2001 - 17:51 #1
du kan får clientens browser oplysninger med et javascript.
Avatar billede clinton-2 Nybegynder
29. november 2001 - 17:54 #2
jeps, det er vi klar over, men det var ikke det spørgsmålet lød på; men nu du er igang, hvor kommer de oplysninger fra man får med javascripts navigator obejekt?
Avatar billede flyhigh Nybegynder
29. november 2001 - 18:19 #3
jeg tror de er nogle dll filer eller lignende. men ikk registrerings databasen.
Avatar billede thomasledet Nybegynder
29. november 2001 - 18:45 #4
med environtment variablen $ENV{\'HTTP_USER_AGENT\'} får du den browser at vide, som der bliver sendt med i http-headeren...

De kommer ikke fra reg-databasen... (ved ikke med Internet Explorer)...

For de fleste browseres vedkommende er det hardcoded... (jeg bruger Linux)

Avatar billede reno16 Nybegynder
29. november 2001 - 23:08 #5
http://www.webcafe.dk/perl/artikler/011/pa011.php3 kan du se nogle forskellige enviroment variable...
Avatar billede bajte Nybegynder
25. januar 2002 - 00:40 #6
Direkte kopiering, men ganske informationsrigt alligevel :o)

$ENV{'GATEWAY_INTERFACE'}
What revision of the CGI specification the server is using; i.e. 'CGI/1.1'.

$ENV{'SERVER_NAME'}
The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host.

$ENV{'SERVER_SOFTWARE'}
Server identification string, given in the headers when responding to requests.

$ENV{'SERVER_PROTOCOL'}
Name and revision of the information protocol via which the page was requested; i.e. 'HTTP/1.0';

$ENV{'REQUEST_METHOD'}
Which request method was used to access the page; i.e. 'GET', 'HEAD', 'POST', 'PUT'.

$ENV{'QUERY_STRING'}
The query string, if any, via which the page was accessed.

$ENV{'DOCUMENT_ROOT'}
The document root directory under which the current script is executing, as defined in the server's configuration file.

$ENV{'HTTP_ACCEPT'}
Contents of the Accept: header from the current request, if there is one.

$ENV{'HTTP_ACCEPT_CHARSET'}
Contents of the Accept-Charset: header from the current request, if there is one. Example: 'iso-8859-1,*,utf-8'.

$ENV{'HTTP_ACCEPT_ENCODING'}
Contents of the Accept-Encoding: header from the current request, if there is one. Example: 'gzip'.

$ENV{'HTTP_ACCEPT_LANGUAGE'}
Contents of the Accept-Language: header from the current request, if there is one. Example: 'en'.

$ENV{'HTTP_CONNECTION'}
Contents of the Connection: header from the current request, if there is one. Example: 'Keep-Alive'.

$ENV{'HTTP_HOST'}
Contents of the Host: header from the current request, if there is one.

$ENV{'HTTP_REFERER'}
The address of the page (if any) which referred the browser to the current page. This is set by the user's browser; not all browsers will set this.

$ENV{'HTTP_USER_AGENT'}
Contents of the User_Agent: header from the current request, if there is one. This is a string denoting the browser software being used to view the current page; i.e. Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page's functionality to the capabilities of the user's browser.

$ENV{'REMOTE_ADDR'}
The IP address from which the user is viewing the current page.

$ENV{'REMOTE_PORT'}
The port being used on the user's machine to communicate with the web server.

$ENV{'SCRIPT_FILENAME'}
The absolute pathname of the currently executing script.

$ENV{'SERVER_ADMIN'}
The value given to the SERVER_ADMIN (for Apache) directive in the web server configuration file. If the script is running on a virtual host, this will be the value defined for that virtual host.

$ENV{'SERVER_PORT'}
The port on the server machine being used by the web server for communication. For default setups, this will be '80'; using SSL, for instance, will change this to whatever your defined secure HTTP port is.

$ENV{'SERVER_SIGNATURE'}
String containing the server version and virtual host name which are added to server-generated pages, if enabled.

$ENV{'PATH_TRANSLATED'}
Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping.

$ENV{'SCRIPT_NAME'}
Contains the current script's path. This is useful for pages which need to point to themselves.

$ENV{'REQUEST_URI'}
The URI which was given in order to access this page; for instance, '/index.html'.

De overnævnte variabler eksekveres ved at skrive :

# Eksempel : #
print "Content-Type: Text/HTML\r\n\r\n";
print "IP-Adresse : $ENV{'REMOTE_ADDR'}";
exit;
Avatar billede bajte Nybegynder
25. januar 2002 - 00:42 #7
Vær venligst opmærksom på at backslashes automatisk fjernes :o( Og så ville jeg lige rette det overnævnte til svar, i stedet for kommentar. Og sørme om det ikke rimede.


/BajTe! ;)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester