How to know where my code is running

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
namitjung
Forum Commoner
Posts: 42
Joined: Mon Jun 20, 2005 3:17 am

How to know where my code is running

Post by namitjung »

Hello all,

I am developing projects for client but i don't know where it is running.Client made payment to me and i provide full source code to him.

Is there any php code that would let me know where my php code is running??

Thank you
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Either insert a mail statement or connect to a remote db / file and insert the IP, host etc - just make sure you flag it - so that it doesnt keep notifying you where the php code is running each time the php script is executed !
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Be aware some people may view any inbuilt notification as a "hack". If the contract specifies that the code belongs to them you have may have no "rights" to what they do with it or where they place it. Normally if you build a good working relationship you should be able to just ask them.
namitjung
Forum Commoner
Posts: 42
Joined: Mon Jun 20, 2005 3:17 am

But what does flag mean?

Post by namitjung »

Thank you for your reply.But what does this flag mean?Do i have to check a db field and set it to some value and check that value??

Don't understand clearly. :(
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Place some mark somewhere - db, remote file or whereever - so that you not get notified each and every time the script gets executed.
You'll have to figure out on your own because this is really going behind someone's back.
namitjung
Forum Commoner
Posts: 42
Joined: Mon Jun 20, 2005 3:17 am

Is it good idea

Post by namitjung »

But where i have to mark it. I thought that it should send me mail when admin is login. But each time admin is login,i will get an email. Then i thought creating a table with a field name and then setting it to 0 and when admin is login for the first time set it to one and send an email to me. Next time when admin is login it will check whether the db field is set to zero or not. Is this a good idea?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

bumping a thread within one hour of its last post is very uncool. :x
Post Reply