www.webdeveloper.com
Results 1 to 3 of 3

Thread: display linkedin details in my text fields using php

  1. #1
    Join Date
    Aug 2013
    Posts
    2

    Exclamation display linkedin details in my text fields using php

    i have managed to connect with Linkedin APi, so i can get the users details using below code.
    PHP Code:
    $response $OBJ_linkedin->profile('~:(id,first-name,last-name,picture-url,email-address,phone-numbers)'); 
    if(
    $response['success'] === TRUE) { 
    $response['linkedin'] = new SimpleXMLElement($response['linkedin']); 
    after that i need to display the retrieved details into text fields like this.

    HTML Code:
    <table border="1">
    <tr>
    <td>Name</td>
    <td><?php echo $response['linkedin']->id; ?></td>
    </tr>
    
    
    <tr>
    <td>first Name</td>
    <td><?php echo $response['linkedin']->first-name; ?></td>
    </tr>
    
    <tr>
    <td>Email</td>
    <td><?php echo $response['linkedin']->email-address; ?></td>
    </tr>
    </table>
    Id is displaying correctly, but other details are not showing. can anyone help on this. thanks in advance

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,923
    Are you sure all those keys are supposed to use hyphens, or should they be underscores?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Aug 2013
    Posts
    2
    We cannot use hypens like this.
    <?php echo $response['linkedin']->{'first-name'}; ?>
    this works fine.
    reference
    http://stackoverflow.com/questions/1...elds-using-php

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles