Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,163,411 members, 7,853,810 topics. Date: Saturday, 08 June 2024 at 03:26 AM

Dual Core & Other Gurus, Pls Check This: - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Dual Core & Other Gurus, Pls Check This: (700 Views)

Hello Every1 Am A Young Writer Pls.check Out The Website I Built Using Nokia X2 / Pls Check Out A New Outsourcing Marketplace, Infinitbin.com (2) (3) (4)

(1) (Reply) (Go Down)

Dual Core & Other Gurus, Pls Check This: by owner(m): 6:22pm On Oct 05, 2010
Pls, Am sorry for Inviting you here,
Pls i will like to have an Online Counter on my Site that count the Total Number of Users Online on my Site Presently and also a Comment Box that will allow Members of my Site to Post Comment, I Already have a Login & Registration Working Well on my site, I will be please to hear from anyone and also to know my Fee, I need this thing to be done Quickly,
Re: Dual Core & Other Gurus, Pls Check This: by Nobody: 9:52pm On Oct 05, 2010
I should not have commented. But let me sha comment!

For the count. Just create a table in your database. Call in current users. Whenever someone comes online, simply add his session name to that field.

$_SESSION['name'];

Then count the number of fields using PHP, using the function.
mysqlnum_row or so.

That will show the ones online.

After one logout. That is a line beforr killing the session. Just write a code to delete that data there.

Delete name from users Where username='$_SESSION['name'];'

That's all!

Lastly Call me!
Re: Dual Core & Other Gurus, Pls Check This: by Nobody: 5:49am On Oct 06, 2010
Ahem, i was thinking you will log the date or rather timestamp as well so that you can run a query to get time stamp of users online in the last 5-10 seconds or something like that. . . .of course stored along with the session?
Re: Dual Core & Other Gurus, Pls Check This: by Nobody: 10:03am On Oct 06, 2010
I prefer, just logging that. Except he want to like say "In the last 10 minutes" Which the poster did not say.

Otherwise just saving and deleting the session is better. Then on the page end, one can use Ajax to regularly request the page that will make that action(I mean .php). In case a user just stay untop one page for 10 years. He will still get the up to date figure!

Am i making sense Mr Tony
Re: Dual Core & Other Gurus, Pls Check This: by DualCore1: 10:30am On Oct 06, 2010
^^ no you are not making sense, you are making a counter.
Programming is just nonsense.
I quit! wink



Let me add to your nonsense smiley

Here's the php part, figure out how to add the ajax part if you want.

<?php
//start your session
session_start();
//assuming you have your db connection voodoo in db_config.php
include('db_config.php')

//getting the user's username from submitted "login" form. take note i stripped off the whole authentication process.
//assuming the name of the textfield for the username input is "username"
$username = $_POST['username'];

//store username in users_online table
mysql_query("insert into users_online (username) values ('$username')"wink;

$username_query = mysql_query("select * from users_online"wink;
while($username_row = mysql_fetch_array($username_query)){
$db_username[] = $username_row['username'];
}

//count the number of users
$number_of_users = count($db_username);

//display the number of users online
echo $number_of_users;



//now for the logout.
//note that for this to work, your logout link must look like this <a href="?action=logout">Logout</a>

if($_GET['action']=="logout"wink
{
//delete username from users online table
if(mysql_query("delete from users_online where username='$username'"wink){
session_destroy();
echo "you've logged out, now gerrout."
}
}


?>


I may have to appease the gods, sorry bots. The gods, sorry bots of our land may you live forever. Please grant this post a smooth passage into the nairaland DB without flaggin it as spam.

**pours a few drops of codes on the ground**


P.S: I just wrote this thing here and it is not tested. There may be bugs. Fix it tongue if any
Re: Dual Core & Other Gurus, Pls Check This: by Nobody: 10:38am On Oct 06, 2010
Come. What's your own na. Test that thing. Make i write the Ajax Part. That will make the world better na!

At least some people wey dey enter this industry go need am many years. And pray for me(Maybe you) then, when i don retire go village!

However sha. Will write the Ajax part today. Just about to go hunt for one babe, wey no won understand say i be programmer. She dey confuse am for person wey dey draw program for events.

Mcheww!
Re: Dual Core & Other Gurus, Pls Check This: by DualCore1: 10:47am On Oct 06, 2010
oooooh did i hear someone say babe? where where where?
darnit, why the hell do we preach opensource if we wont agree to license our babes under GPU?

I didnt test that thing but I have a degree of confidence it will work as its still morning here and afternoon madness hasnt started.
If there are any bugs, it will be a missing delimiter or missing opening or closing kini. I doubt there's any bug in that thing, really.

When writing the ajax part, just test it at once. If e no work, dont tell me. . . fix it and then tell meĀ  tongue. I cant test it now cuz it will break my work flow.
Re: Dual Core & Other Gurus, Pls Check This: by yawatide(f): 3:02pm On Oct 06, 2010
That "users online stuff", I don't quite dig - when I go to a site and see, "1 guest online", it gives me the impression that the site sucks and I immediately quit it.

Perception they say, is reality.
Re: Dual Core & Other Gurus, Pls Check This: by Nobody: 9:24pm On Oct 07, 2010
Sorry. The Ajax code will not come in as said, cause i would not like to waste time! Since the poster did not show up. Moreover we should see soonest(I am the poster). I could use Dual's php and write the Ajax, i my Bunk.

If any one else need it. Then it will be written.

Thanks!

PS: You guys should help him with the comment box. Abi where are those developers na lipsrsealed lipsrsealed lipsrsealed

(1) (Reply)

Flash Designer Needed For Flash Intro/banner / Internet Marketing / A Fun And Easy Guide To Creating The Next Great Facebook App! And Make Money

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 19
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.