Can I collect informations about my visitors (such as email, location...etc) in a file located on my srever ? If it is possible, tell me please how to do it.
Thanks, but I am beginner and I want to download and use finished script
Which php function use for:
1) Display visitor's IP
2) Display visitor's operating system & browser ?
I need those functions to put them into home page, and run on page load. Is it possible, and how to do?
$_SERVER['REMOTE_ADDR'] will get you the IP
$_SERVER['USER_AGENT'] will get you the browser and OS in 'techie format' (IE, all the technichal details as well (Its not a real word, I coined it;) ))
USER_AGENT will display something like this:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3
The alternative for the OS and or browser is to use JS to get the details, then pass it to the script in the url ($_GET format)
Is it possible to host php script on another server than my site is hosted?
IMHO I don't really its possible.
Think about it, you have a budding forum (like frihost) All you'd have to do is include the config file, and boom - You'd have access to their forum db details, and coulddo whatever you wanted to them.
There may be a way to do it, but think about it logically as well-
The way a web server works when recieving a request for a dynamic page, is that it process' it before returning it.
The server doesn't distinguish weither the requester is a human, or a script, it just process' it and returns it.
So by including a remote php script, you're in effect including a html file.
You can however save the PHP in a .txt file and then include it.