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

  • Home
  • SEARCH
  • 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 523275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:26:27+00:00 2026-05-13T08:26:27+00:00

Hey guys I am using open id authentication on my website and after authenticating

  • 0

Hey guys I am using open id authentication on my website and after authenticating I am getting a url from openid providers i.e yahoo and google

http://www.mysite.com/openid-login.php?
openid.identity=https://me.yahoo.com/a/1234567&
openid.ax.value.nickname=john&
openid.ax.value.email=john@yahoo.co.in&


http://www.mysite.com/openid-login.php?
openid.identity=https://www.google.com/accounts/o8/1234567&
openid.ext1.value.email=kevin@gmail.com&
openid.ext1.value.country=IN

I have trimmed the urls a bit for clarity. I would like to create a single function for both that can set the email(if exists), nickname(if exits), identity(openid ina ) in an array and return the values. eg.

function userdetails(array_get){
......
......
return $userdetails;
}
$userdetails =userdetails($_GET);

$userdetails[‘nickname’] would give me the nickname if exists and similarly for the email and identity. Thanks

  • 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-13T08:26:28+00:00Added an answer on May 13, 2026 at 8:26 am

    I did not create this function nor take credit for it. This was pulled and modified from the Simple OpenID library. If somebody has a link please post it in the comments as I don’t have access to the original source.

    /**
     * Method to filter through $_GET array for requested user information.
     * Will return an array of trimmed userinfo.
     */
    public function filterUserInfo($arr_get) {
        $valid_ax_types = array('nickname' => 1, 'email' => 1, 'fullname' => 1, 'dob' => 1, 'gender' => 1, 'postcode' => 1, 'country' => 1, 'language' => 1, 'timezone' => 1, 'firstname' => 1, 'lastname' => 1);
        $userinfo = array();
        foreach ($arr_get as $key => $value) {
            // trim the key
            $trimmed_key = substr($key, strrpos($key, "_") + 1);
    
            // check for valid openid_ext1 values
            if (stristr($key, 'openid_ext1_value') && isset($value[1])) {
                $userinfo[$trimmed_key] = $value;
            }
    
            // check for valid openid_ax values
            if (stristr($key, 'openid_ax_value') && isset($value[1])) {
                $userinfo[$trimmed_key] = $value;
            }
    
            // check for valid sreg_ values
            else if (stristr($key, 'sreg_') && array_key_exists($trimmed_key, $arr_ax_types)) {
                $userinfo[$trimmed_key] = $value;
            }
        }
        return $userinfo;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 276k
  • Answers 276k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This page on the Scala wiki is a good starting… May 13, 2026 at 2:42 pm
  • Editorial Team
    Editorial Team added an answer Then I shut down my server application even then the… May 13, 2026 at 2:42 pm
  • Editorial Team
    Editorial Team added an answer What version of JUnit are you using? It looks like… May 13, 2026 at 2:42 pm

Related Questions

Hey guys, I would like to develop a light/laser show editor and simulator, and
Hey guys, I am having trouble with what seems to be fairly easy. Let
Hey guys. I have a method that gets called each second which I want
hey guys, like the title says, how can i accomplish this sort of a
Hey guys, I want to store a categorized list of URLs. This is an

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.