Reputation: 1800
I am using canvas for application development and the CodeIgniter framework.
I have a link in a view, <a href='http://example.com/index.php/module/controller/action'>click here</a>
and I have a controller as:
public function index() {
$user_profile = $this->facebook->api('/sujeet216');
$token = $this->session->userdata('token');
$response = $this->fb_model->checkUser($token);
if ($response->num_rows <= 0) {
if($this->fb_model->insertUser($user_profile,$token)) {
$this->load->view('intro',$user_profile);
}
}
else {
$this->load->view('index',$user_profile);
}
}
public function intro2() {
$this->load->view('intro2');
}
Whenever I click a link, it redirects to the index controller. How do I load intro2
page from the second function?
Upvotes: 0
Views: 684
Reputation: 11054
If you're not routing the URL, index.php/module/controller/action
goes to index.php/controller/method/parameter
. Try redirecting to index.php/controller/intro2
.
Upvotes: 1
Reputation: 422
It's possible that the app is trying to authenticate and Facebook redirects the app back to the callback URL that you have set. You have two options to combat this:
I'd recommend going for option number 1 as it gives you much more flexability in relation to using the API once the user has authenticated against Facebook.
Upvotes: 1