By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,763 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,763 IT Pros & Developers. It's quick & easy.

Send mail listing the maximum number of users online on a particular date

P: 13
Hello All,

I have a table where i am maintaining the users' ip address and the date when they are accessing the website.

so its like i have 3 fields in the table like

ip_id - auto_increment not null primary key
ip_address - holds the ip address of the user browsing the site
date - the particular date when the user was online on the website

I now need to get the entire list of users and their ip addresses who browsed the website for a particular day.

and this list of users' ip addresses needs to be sent in a mail to the admin of the site.

Any ideas how to go about it?

Regards,
Dream2rule
Aug 24 '07 #1
Share this Question
Share on Google+
3 Replies


nathj
Expert 100+
P: 938
Hello All,

I have a table where i am maintaining the users' ip address and the date when they are accessing the website.

so its like i have 3 fields in the table like

ip_id - auto_increment not null primary key
ip_address - holds the ip address of the user browsing the site
date - the particular date when the user was online on the website

I now need to get the entire list of users and their ip addresses who browsed the website for a particular day.

and this list of users' ip addresses needs to be sent in a mail to the admin of the site.

Any ideas how to go about it?

Regards,
Dream2rule
Hi,

You could select the ip addresses frm the table with an appropriate where clause:
[php]
// $ldDate is defined as the date you are searching for
$lcSelect="Select ip_address from table_name where date = $ldDate";

// run the query
[/php]
You can loop through the resuls of the sql building up the message of your email.

The mail could be sent using the php mail() class. It's really a case of a simple SQL query followed by a loop to process the results.

Have a go at that and if you get stuck post your code and I'll try to help you out some more.

Cheers
nathj
Aug 24 '07 #2

P: 13
i got the working of the mail but i need to know how do i sent it only once in a day i.e preferably all the users online throughout the day and their corresponding addresses needs to be sent to the administrator everyday.. I have the system date. Any help?
Aug 27 '07 #3

nathj
Expert 100+
P: 938
i got the working of the mail but i need to know how do i sent it only once in a day i.e preferably all the users online throughout the day and their corresponding addresses needs to be sent to the administrator everyday.. I have the system date. Any help?
It seems that you want to fire an event to gather data and send and email regarding that data based on time rather than page impressions or user clicks.

The low tech colution would be to have a process that does what you're after that you call manually - I said low tech. This would at least prove to you that the system works.

then moving on from there you need some sort of timer based process. This is not something I have ever done, but it does sound interesting. Perhaps your web host has some facility for this. I belive under Unix system Cron is the way to do this. As I say I have no experience in this at all so I don't pretend to be an expert here.

Sorry I can't be any more help.

Cheers
nathj
Aug 28 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.