TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-18-2005, 10:37 PM   #1 (permalink)
The Wanderer
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
AndyM3 is on a distinguished road
Default ..........

Fixed - ignore.

Last edited by AndyM3 : 12-20-2008 at 02:49 AM.
AndyM3 is offline  
Reply With Quote
Old 04-18-2005, 10:41 PM   #2 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

Can you have access to a database for all the domains?
CreativeLogic is offline  
Reply With Quote
Old 04-19-2005, 01:02 AM   #3 (permalink)
The Wanderer
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
AndyM3 is on a distinguished road
Default

Fixed - ignore.

Last edited by AndyM3 : 12-20-2008 at 02:49 AM.
AndyM3 is offline  
Reply With Quote
Old 04-19-2005, 01:07 AM   #4 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

OK. I can think of two ways of doing this. Either insert all the information into a single database on every domain acessing the same database. Or have a seperate database for each site and output the number of visitors with a seperate PHP file and pull the number outputted from each page. The first way would be the way I would go but it's a little harder to setup.
CreativeLogic is offline  
Reply With Quote
Old 04-19-2005, 01:12 AM   #5 (permalink)
The Wanderer
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
AndyM3 is on a distinguished road
Default

Fixed - ignore.

Last edited by AndyM3 : 12-20-2008 at 02:49 AM.
AndyM3 is offline  
Reply With Quote
Old 04-19-2005, 01:16 AM   #6 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

Yes they would. Just #2 would have more queries.
CreativeLogic is offline  
Reply With Quote
Old 04-19-2005, 01:16 AM   #7 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

Hold on and I'll try to write something up real quick.
CreativeLogic is offline  
Reply With Quote
Old 04-19-2005, 01:24 AM   #8 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

This is untested but it should work.
online.php
Code:
// delete old visitors
$timeout = time() - 60 * 5; // 5 minutes
mysql_query("DELETE * FROM sessions WHERE lastvisit < $timeout");

// update user
mysql_query("REPLACE INTO sessions SET lastvisit = '" . time() . "'");

// query users
$thisdomainquery = mysql_query("SELECT COUNT(*) AS totalusers FROM sessions");
$thisdomain = mssql_fetch_array($thisdomainquery);

// will output users on this site
echo $thisdomain['totalusers']; 

// pull info from other sites
// this will pull the info from the other domains with each new line as an array element
$network = file('http://www.anotherdomain.com/online.php'); 
$networktotal += $network[0];

// add the above two lines for all the sites you wish

Last edited by CreativeLogic : 04-19-2005 at 04:25 PM.
CreativeLogic is offline  
Reply With Quote
Old 04-19-2005, 01:37 AM   #9 (permalink)
The Wanderer
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
AndyM3 is on a distinguished road
Default

Fixed - ignore.

Last edited by AndyM3 : 12-20-2008 at 02:49 AM.
AndyM3 is offline  
Reply With Quote
Old 04-19-2005, 03:46 PM   #10 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

You will need to create a database. According to my script above you will need to name the database table sessions. Then you have to have a row in that table named lastvisit.

By the way I left something out of there. One of the most important parts. I'll change it in a little bit.
CreativeLogic is offline  
Reply With Quote
Old 04-19-2005, 04:42 PM   #11 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

I updated the script and actually tested it this time. I decided that it was not a very good way to go about this script. It makes the page lag and if a site is down will make the page hang for a very long time. I will update the code to make it work with one database shortly. If the sites are all on the same server you'll run into no problems. If not you will have to allow the ipaddress of the server to access the database.
CreativeLogic is offline  
Reply With Quote
Old 04-19-2005, 10:24 PM   #12 (permalink)
The Wanderer
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
AndyM3 is on a distinguished road
Default

Fixed - ignore.

Last edited by AndyM3 : 12-20-2008 at 02:49 AM.
AndyM3 is offline  
Reply With Quote
Old 04-19-2005, 10:58 PM   #13 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

You will need to use one database and just link all the sites to the one server. It shouldn't be too rough especially if you have cPanel. It's rather easy to setup in cPanel. I've been rather busy today. I'll see if I can't help you out later tonight and if not tomorrow.
CreativeLogic is offline  
Reply With Quote
Old 04-19-2005, 11:09 PM   #14 (permalink)
The Wanderer
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
AndyM3 is on a distinguished road
Default

Fixed - ignore.

Last edited by AndyM3 : 12-20-2008 at 02:49 AM.
AndyM3 is offline  
Reply With Quote
Old 05-08-2005, 03:44 AM   #15 (permalink)
The Wanderer
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
AndyM3 is on a distinguished road
Default

Fixed - ignore.

Last edited by AndyM3 : 12-20-2008 at 02:49 AM.
AndyM3 is offline  
Reply With Quote
Old 12-20-2008, 02:55 AM   #16 (permalink)
The Acquainted
 
KingOfTheSouth's Avatar
 
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
KingOfTheSouth is on a distinguished road
Default

lol wgt do you keep posting fixed-ignore?
KingOfTheSouth is offline  
Reply With Quote
Old 12-20-2008, 04:48 AM   #17 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Please don't edit your posts when you solve something, you probably aren't the only person to have whatever problem it was so leaving it could be of use to someone. It is considered good etiquette on help forum to leave your posts in tact.
__________________

Village Idiot is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar script needs template system nonenone General 3 04-16-2005 04:15 AM


All times are GMT. The time now is 06:05 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design