Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Small Call Back Script Need For Software

Posted on 2005-02-25
4
Medium Priority
?
190 Views
Last Modified: 2006-11-17
Hello,

I am looking for a small script which can used as a call back script meaning, I should know where my script is running like, IP Address and domain name.

Is there anyway anyone can please write me a small script. Also please suggest how should I know that where my script is running .


Thanks.
0
Comment
Question by:wcws
3 Comments
 
LVL 5

Expert Comment

by:mrielf
ID: 13408558
This can't be done with PHP because your script is running on your server...

If you want to know who browsing your page, then you need some client side scripting
(not enough to query the browser IP on server side because might visitor is browsing through proxy...)
0
 
LVL 1

Accepted Solution

by:
wasco earned 1000 total points
ID: 13410656
to do a quick and dirty answer

print_r($_SERVER)

this will show you alot of data about the current page and its location and of yourself
YOUR ip address etc
all you need to do is save the information you would like to see as an administrator in a file or database
e.g. at the top of each page you add a new row in a database table called 'visits'

visits
-----
id - integer(11), autonumber
date - integer(11)
ip - varchar(50)
host - varchar(200)

in the php page query your db
insert into visits(date, ip,host) values (time(),$_SERVER['REMOTE_ADDR'],$_SERVER['REMOTE_HOST'])


each user that visits a php page with this code in will generate a record in your visits table, so you can see who visits your pages and when

it is advisable to auto-clean the table as it will generate alot of record fairly quicly.
so it might be a good idea to do a delete from table where date < e.g. a week ago each pagevisit

you can create the necessary code-number for the date 'a week ago' using the mkdate() function of php

for a full list of values in the $_SERVER variable:
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server
0
 
LVL 6

Expert Comment

by:merwetta1
ID: 15643459
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept wasco's comment as answer

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

merwetta1
EE Cleanup Volunteer
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question