<?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
Recommended Answers
Jump to PostIs the error message saying headers are sent on line
header ('location: user/dashboard.php');
or is the error being thrown fromdashboard.php
?Usually I get that error when I
session_start();
on the target file. If that is the case, you're probably callingsession_start();
on both files and …
Jump to PostHi,
If you are getting error like "headers already sent" mens you are showing something before header('location: user/dashboard.php');
This may be a single space or any error. Also try to remove any blank space / balank lines before using header('location: user/dashboard.php');
If you need more help, Please let me know.
…
All 6 Replies
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.