<?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 ($_SESSION as $key => $value) {
//echo $key ." = > ".$value."<br />";
//}
header ('location: user/dashboard.php');
exit();
}
?>
Ahmed_48 0 Newbie Poster
Ahmed_48 0 Newbie Poster
Fernando_4 0 Junior Poster in Training
Ajay Gokhale 0 Newbie Poster
Fernando_4 0 Junior Poster in Training
Ahmed_48 0 Newbie Poster
Fernando_4 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.