/    Sign up×
Community /Pin to ProfileBookmark

How can I make my image upload script save IP’s?

Hello, I would like this script to save the ip of the uploader, and the image file name to a text file, in case of abuse or illegal content.

[url]http://88.148.193.224/php/[/url]

The codes are in there, how would/should I do it?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@Jarrod1937Nov 01.2010 — Sorry, i won't write code for you, but i can explain the general process. Essentially you can grab their ip via:

$ip_address = getenv("REMOTE_ADDR");

There are more robust functions out there to grab the ip if you find you need it. If you're saving the image name to a database table, you can simply create a separate field right after it and store the ip in it.
×

Success!

Help @JereHakala spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...