Member Avatar

<?php //The fields and values to insert $user = array( 'users_screen_name'=>$vars ->screen_name, 'users_profile_image_url'=>$vars -> profile_image_url, 'users_name'=>$vars->name, 'users_statuses_count'=>$vars->statuses_count, 'users_location'=>$vars->location, 'users_description'=>$vars->description, 'users_oauth_access_token'=>$access_token['oauth_token'], 'users_oauth_access_token_secret'=>$access_token['oauth_token_secret'] ); // chek existing $check_column = 'users_id'; $exists = $database->exists( 'useres', $check_column, array('users_screen_name' => $vars ->screen_name )); if (!$exists) { $add_query = $database -> insert('useres', $user); if ($add_query) { //update informations include 'get_user_info.php'; } } else { $rs = "SELECT * FROM useres where users_screen_name ='".$vars ->screen_name."'"; $user = $database -> get_results($rs); // add the informations to the session foreach ($user as $key => $value) { foreach ($value as $key => $value) { $_SESSION[$key] = $value; } } //foreach …

Member Avatar
0
49
Member Avatar

Hi i am working on a server sent event script to be sent when the user has logged out, but in the network tab the server sent pages are being sent every couple of seconds with no data. Client-Side script var source=new EventSource("include/updates.php"); source.addEventListener('logout',function(event){ $("#notificationsContainer").append(event.data + "<br />"); source.close(); },false); Server-side script header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); if(!isset($_SESSION)) session_start(); if(!isset($_SESSION['id'])) { $time = date('r'); echo "event: logout\n"; echo "data: user logged out at {$time}\n\n"; flush(); } Thanks for your time,

Member Avatar
0
3
Member Avatar

Hello all, I am having problems with this code. Whenever I attempt to test the login system with a valid username and password, it says this: You have successfully logged in! Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/ucairwebsite/facultykadrmas/kadrmaspages/login_1/login_LDDB.php:1) in /Applications/XAMPP/xamppfiles/htdocs/ucairwebsite/facultykadrmas/kadrmaspages/login_1/login_LDDB.php on line 213 The "You have successfully logged in is what I have echoed, but the rest I am not sure of the rest. I hope you guys can help. What is weird is it works just fine when it is the only code on the page when I attempt to apply it …

Member Avatar
0
6

The End.