checkit923
checkit923

Reputation: 81

Save variable on files name

I have the following function used to track users page visits and ips:

function log_good_ip($user, $ip, $web, $browser) {
        $file = 'logs/ip_good.txt';

What I would like is for each user to have their own text file where their email is on the files name, for example the user logged on is abc123, this will save as ip_good.abc123.txt.

Thanks!

Upvotes: 0

Views: 36

Answers (1)

AW101
AW101

Reputation: 1640

Try:

$file = 'logs/ip_good.'.$user.'.txt';

Upvotes: 1

Related Questions