Grow your CSS skills. Land your dream job.

Output value of nested arrays?

  • # January 16, 2013 at 1:38 am

    @chrisburton

    Everywhere I see it in that article, `isset()` (and/or `empty()`) is being used during the oauth process – e.g., to check what the response returned. The Opauth example does this as well (are you still using the opauth class?).

    Yes, those checks should remain.

    However, don’t use them when(if) you’re accessing the results via the `twitter_user` class:

    #no
    if( isset( $twitter_user->name ) ){
    print $twitter_user->name;
    }

    #yes
    print $twitter_user->name;

    *****
    **edit**

    *Also, the code in that article uses the mysql_…() functions.*

    *ext/mysql is long outdated and will be deprecated in PHP 5.5. It **should not be used** in new work (try [ext/mysql**i**](http://php.net/mysqli) or [PDO](http://php.net/pdo) instead).*

    # January 16, 2013 at 1:43 am

    @traq I mean, as long as it’s secure, I’m not worried about it. I just want to make sure the users info is not vulnerable. It looks like I have a lot to learn. By the way, when you get Kirby up and running, I’d love to see you create a plugin that does this.

    Regarding Opauth class, I’m not sure. What I sent you is what I am still using. I just pasted your code below the code that Opauth comes with.

    # January 16, 2013 at 10:30 am

    @chrisburton

    Keeping the checks will prevent errors. It may not lead directly to security vulnerabilities, but it definitely makes for better UX and also best coding practice.

    > It looks like I have a lot to learn.

    Everyone does. That’s the fun part.

    > By the way, when you get Kirby up and running, I’d love to see you create a plugin that does this.

    Maybe. I’ll have to see how easy it is to integrate.

    > I just pasted your code below the code that Opauth comes with.

    which is exactly what I did; works great (that example is on one of my old domains that is still running PHP 5.2). Taking the code you gave me, those minor changes to my class are all it took.

    # January 16, 2013 at 1:28 pm

    @traq – super forum props for helping Chris out with this. I’ve been following this thread and have admired your dedication to the problem!

    # January 16, 2013 at 3:43 pm

    @TheDoc – thanks very much. I’ve enjoyed it …and my own projects may benefit from this as well :)

    # January 16, 2013 at 5:29 pm

    @traq @TheDoc Yes, absolutely. I really appreciate all the help that you have given. I’m glad that we can both benefit from this as well. Thank you for everything.

    My apologies for being MIA for the past couple of days. It’s been stressful getting everything ready for this semester of college.

    # January 16, 2013 at 8:47 pm

    You’re quite welcome, thank you.

    Just to clarify, is this working for you now?

    # January 16, 2013 at 8:53 pm

    @traq Working 100%. Much easier to write also so that’s a definite plus. Thanks again, I owe you one.

    # January 16, 2013 at 11:53 pm

    no prob. cool.

Viewing 9 posts - 31 through 39 (of 39 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".