Jump to content

Flyer5

New Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Flyer5's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I know nothing at all about ajax, but this looks grand. Im off to do some reading! Thanks for the advice.
  2. Yeah thats what im trying to do, i kinda have this: (but im now lost!) $uname = $_SESSION[_LICENSE_KEY_]['user']['user'] ;// get the persons etano user name $utime = time(); // get the time $uname_check = 'SELECT uname FROM `in_chatroom` WHERE uname = $uname'; $uname_query = mysql_query($uname_check); $num_rows = mysql_num_rows($uname_query); if(!$num_rows) { //if no rows, meaning no uname's in db matched theirs, we will add them. $insert_new = mysql_query("INSERT into in_chatroom (utime, uname) values('$utime','$uname')"); } //end if NOT THERE //this means that they're already in there, so we update info. if($num_rows > 0) { $update = mysql_query('UPDATE `in_chatroom` SET utime=\''.time().'\' WHERE uname = $uname'); if(!$update) die(mysql_error()); } // end UPDATE //if time now - start time > 300 then its been 5 minutes, so we delete $delete_old = mysql_query("DELETE FROM `in_chatroom` WHERE ((".time()."-utime) > 300)"); if(!$delete_old) die(mysql_error()); When you access the page it adds the username and time to the db table ok, but now im stuck!
  3. Hi I have a club site, and on it we have a chatroom, its a basic thing but works ok, but it lacks a whose online list, so you can not see who else is currently on the chat page There is no need to log in to the chat, the users must log into the web site first and the chat name is taken from the session array when they open the chat page, What would be the best way to track the user is on the chat page (and therefore in chat) and output a table of online users? Im guessing its adding the user to a table when they open the page, then checking they are still here after a few minutes? Any advice greatly appreciated! Especially if anyone knows of something already written I can just incorporate! Cheers F5
  4. Thank you! I was overlooking the obvious, once id uncommented the include for the defines everything worked! couldn't remember commenting it in the first place lol. Cheers F5
  5. this is it... Array ( [uNEMEXADUWEWUFENAWUGAD] => Array ( [user] => Array ( [skin] => def [user] => ***** [membership] => 4 [prefs] => Array ( [datetime_format] => %m/%d/%Y %I:%M %p [date_format] => %m/%d/%Y [profile_comments] => 1 [rate_my_photos] => 1 [time_offset] => 0 ) [user_id] => 2 [status] => 15 => ***************** [pstat] => 15 [loginout] => 1424507388 [timedout] => Array ( => http:/**********************/home.php [method] => GET [qs] => Array ( ) ) ) )
  6. I have a headache trying to solve this! I have a custom php page that uses the normal etano structure, ie custom.php in the root dir calls the html page and css etc. in the skins folder The session array exists in all the pages and the values in the array and sess id etc are all correct, as evidenced with a print_r But, if i use $name = $_SESSION[_LICENSE_KEY_]['user']['user'] ; (user is a array called user with a value in it called user) on any page where the array exists $name is always returned empty. I expected the above to just extract the value of user from the session and store it locally in $name, but its not retrieving the value, or its not storing it any ideas you php'ers! Ta.
  7. Can anyone tell me why this fails? Value is passed from a form, and printing all the variabls shows they are correctly passed. ----------------------------------------------- if(isset($_POST['update'])) (connection to database is here) $house_number = $_POST['house_number']; $query = "UPDATE asw_users (house_number) VALUES ('$house_number') WHERE username='".$_SESSION['username']."' "; mysql_query($query) or die('Error, updating query During update proc failed'); ------------------------------------------------------------ it looks simple enough but i cant get it to update the db any ideas? ta.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.