?
Solved

Small Call Back Script Need For Software

Posted on 2005-02-25
4
Medium Priority
?
186 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

762 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