Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7442839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:14:13+00:00 2026-05-29T11:14:13+00:00

its been I while since I try to solve that problem, I’ve already asked

  • 0

its been I while since I try to solve that problem, I’ve already asked it here, but didn’t get any response, I’ve been googleling my problem in every sense but I just can’t make it.
I just need to know how could I get a valid url when I send to FaceBook my url I want FaceBook to redirect my user back : site_url(‘main/verification’) (I’m working with codeIgniter)

so my loginUrl looks like this :

https://www.facebook.com/dialog/oauth?client_id=248650435198175.&.redirect_uri=http%.3A%.2F%.2Flocalhost%.2FSocialCart%.2Findex.php%.3F%.2Fmain%.2Fverification&state=004dc1ebe9e081b2222408434af7dbd5&scope=email

(DELETE ALL POINTS AFTER ALL THE %)

once I click on the link, I’m directed to FaceBook, but then, I’m redirected to my main page (and not main/verification) with that URL in my browser :

http://localhost/SocialCart/index.php?%.2.Fmain%.2.Fverification&state=0e3ae6ca3e7869f618d65ad&code=AQCwwZUevy-SfeNLgUC55Rg0bi7noi_oczwt_2TmR-DobC8xc6STYIW82VLi23fzf9d-J5tdufdOLpc#_=_

Well I’ve deleted a part of that long code but you see that I get, after my index.php? an %.2.F instead of an / and the & should be ? (I think)

(remove the points ‘.’ between every %2 and 2F)

How could I fix it please ? WHY is my redirectUrl only partially decoded by my browser ? it seems to decode until the index.php and then, it stops replacing all the ‘%.2F’ by ‘/’ (once again no point after the %)
I guess I’m gonna need the url rewriting or urlencode() functions but the fact is that only half of the url is well interpreted, and not the rest. I really don’t now what to do ..

I guess I have to check into the getLoginUrl() function, its the function which is in charge of retrieving the part of the login url that redirect the user from fb to my websiteif the url is well encoded but I’ve tried everything and nothing seems to work.

Here is the function (that you can find in any base_facebook.php of the php API graph.) :

  /**
   * Get a Login URL for use with redirects. By default, full page redirect is
   * assumed. If you are using the generated URL with a window.open() call in
   * JavaScript, you can pass in display=popup as part of the $params.
   *
   * The parameters:
   * - redirect_uri: the url to go to after a successful login
   * - scope: comma separated list of requested extended perms
   *
   * @param array $params Provide custom parameters
   * @return string The URL for the login flow
   */
  public function getLoginUrl($params=array()) {
    $this->establishCSRFTokenState();
    $currentUrl = $this->getCurrentUrl();

    // if 'scope' is passed as an array, convert to comma separated list
    $scopeParams = isset($params['scope']) ? $params['scope'] : null;
    if ($scopeParams && is_array($scopeParams)) {
      $params['scope'] = implode(',', $scopeParams);
    }

    return $this->getUrl(
      'www',
      'dialog/oauth',
      array_merge(array(
                    'client_id' => $this->getAppId(),
                    'redirect_uri' => site_url(), // possibly overwritten
                    'state' => $this->state),
                  $params));
  }

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:14:14+00:00Added an answer on May 29, 2026 at 11:14 am

    Don’t make any changes in base_facebook.php
    Use following code:

    $params = array(
      'scope' => 'read_stream, friends_likes',
      'redirect_uri' => site_url(‘main/verification’)
    );
    
    $loginUrl = $facebook->getLoginUrl($params);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Its been a while since I had to do some Java/JSP... I have a
Trying to wrap this short example in C++. (and its been a while since
So this is a purely academic question, mostly as its been a while since
So its been a while since I last touched the GUI for this application.
It's been a while since I've had to do any HTML-like code in Vim
It's been a while since I've programmed a GUI program, so this may end
It's been a while since I last coded arm assembler and I'm a little
It's been a while since I was in college and knew how to calculate
It's been a while since I used GTK+, and the last time I did
It's been a while since I programmed in C++, and after coming from python,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.