PHP tracking code needed quickly...

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
IqAndreas
Forum Newbie
Posts: 3
Joined: Mon Jun 15, 2009 1:21 pm

PHP tracking code needed quickly...

Post by IqAndreas »

Hm... First time on these forums. I have started learning PHP, but the syntax is still a bit annoying for me with an Action Script and VB.net background. I still don't get it, why use a period instead of a plus or "&" to merge strings? :roll:

Anyway, I need some code as soon as possible, and hopefully someone can help me! This is quite important, and a little urgent.

I need a PHP script that catches the IP address and any other information about a person such as location, country. Someone ordered products via email from us and used a stolen credit card to pay for them, and now I really want to track them down.

Supposedly they are from Singapore, but I doubt it. The only times they would ever email us is from 3PM to 6PM, which means 3AM to 6AM in Singapore. What business person would be up emailing at 3AM?!?

Basically, the code needs to gather all information from the person, and then email it to me.

I already have a site that will host the script (has to be PHP so it is invisible from the user, no JavaScript), and since I have to pay an additional $10 a month for having a database, the script will have to email the information each time someone views the page.

Please help...
Last edited by IqAndreas on Mon Jun 15, 2009 4:48 pm, edited 1 time in total.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP tracking code needed quickly...

Post by requinix »

If a crime was committed then you'll have more luck letting, say, the FBI track them down. Besides, this isn't your concern - it's the cardholder's. Their bank should be handling this, not you. Meanwhile you go refund the money, but not back to the card of course.

All PHP can get is an IP address, and if they're emailing you then you can get it already from the message headers.
User avatar
jazz090
Forum Contributor
Posts: 176
Joined: Sun Apr 12, 2009 3:29 pm
Location: England

Re: PHP tracking code needed quickly...

Post by jazz090 »

well i know of a system that points out city and country using IP adress and its around 97% acureatte if you keep it up to date
IqAndreas
Forum Newbie
Posts: 3
Joined: Mon Jun 15, 2009 1:21 pm

Re: PHP tracking code needed quickly...

Post by IqAndreas »

tasairis wrote:If a crime was committed then you'll have more luck letting, say, the FBI track them down. Besides, this isn't your concern - it's the cardholder's. Their bank should be handling this, not you. Meanwhile you go refund the money, but not back to the card of course.

All PHP can get is an IP address, and if they're emailing you then you can get it already from the message headers.
Obviously you don't live in America. Who ever heard of the Government actually doing something? They don't go after the smalltime crooks. If you want something done, you do it yourself.

Who am I supposed to call, anyway?
"This is 911, how may I help you?"
"Yes, I'd like to report credit card fraud."
"Please come in to our office during our open hours and fill out forms AB436-9 in triplicate, and we will get back to you in approximately 18 months. Have a nice day"

[/realistic dramatization]

We have contacted the banks of the cardholders, and we blocked off the cards, but that still leaves someone out there who is not going to stop their criminal activities.

I do have the email headers, and I glanced through them, but I really have no experience with them, so I don't know which IP addresses point to the person's mail server and which ones point to their actual IP address etc. Do you mind, if I post them here or send them to you via PM, could you take a look at them and decode the jumble for me?

Sadly, the client is using a netzero account, they aren't using an official business email server. Curiouser and curiouser.


I just need something working that can go up on the corporate website that let's me know roughly where this person is located. Even if I can just get the IP address, that might be a start, even though they might be using a forwarding service, but it's worth a try.


Or maybe I should just take the $16,000 in the account and run. :mrgreen:


Or if anyone knows the number to a government official who would actually listen, I would be more than glad to call.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP tracking code needed quickly...

Post by requinix »

I'll skip past the insults and rhetoric because they're annoying.

Not only is it not your business, you aren't allowed to be doing it. Even if you're far left-wing, vigilantism is still illegal.
Okay, so you get their IP address. Then what? Are you going to fly to Singapore, convince the person/group to fly back here with you, and try a citizen's arrest? You have no authority: not here, not there. There is nothing you can do.
IqAndreas
Forum Newbie
Posts: 3
Joined: Mon Jun 15, 2009 1:21 pm

Re: PHP tracking code needed quickly...

Post by IqAndreas »

tasairis wrote:I'll skip past the insults and rhetoric because they're annoying.
Forgive me. I have been at work all day, so the only part of my brain still with some energy is the sarcastic one. I lost logic and diplomacy some time right after lunch.
tasairis wrote:Not only is it not your business, you aren't allowed to be doing it. Even if you're far left-wing, vigilantism is still illegal. You have no authority: not here, not there. There is nothing you can do.
Alright. Then let's pretend I never told you guys the story of why I want this code.


Can anyone write me some code that gets the IP address and any other people who visit our site so we can easier help them like a true American business? :)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP tracking code needed quickly...

Post by requinix »

Again, I'll ignore the patriotic rhetoric.
IqAndreas wrote:Alright. Then let's pretend I never told you guys the story of why I want this code.
Then I, for one, would turn right around and ask why you needed this information.

Fine. Whatever. Don't care.
$_SERVER["REMOTE_ADDR"]
Theoretically it will have the IP address of the person viewing the thing.
Beware of proxies: sometimes they'll send a X_HTTP_something header (I forget what exactly, never used it myself) with the user's actual IP (REMOTE_ADDR would give you the proxy's).

Code: Select all

<?php
 
// displays a small image while logging the user's IP address in ip.txt
 
header("Content-Type: image/gif");
readfile("1px.gif"); // 1x1 pixel transparent image
 
$h = fopen("ip.txt", "a");
fwrite($h, $_SERVER["REMOTE_ADDR"] . PHP_EOL);
fclose($h);
// or you could log to a database, send an email, etc
 
?>
Post Reply