ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

parse order problem user defined variables

October 02, 2012 7:38am

Subscribe [1]
  • #1 / Oct 02, 2012 7:38am

    Thomas Hartmann

    170 posts

    Hi there

    I want to do following code:

    <?php
    
    $mail = "{email}"
    $mail = urlencode($mail);
    
    ?>

    PHP is set to output, but user defined variables are parsed after that.
    How can I do this?

    Best, Thomas

  • #2 / Oct 03, 2012 3:46pm

    Dan Decker

    7338 posts

    Hi Thomas,

    You would need to access that through the userdata object:

    $this->EE->session->userdata('email');

    Since that is PHP as well, it will parse at the proper time.

    ~

     

  • #3 / Oct 04, 2012 5:56am

    Thomas Hartmann

    170 posts

    thx Dan!
    What about custom member fields?

  • #4 / Oct 05, 2012 2:49pm

    Dan Decker

    7338 posts

    You can access those with an SQL query if you need to. They are available in the EE object via PHP like basic user data.

    You can use SQL in PHP or with the Query Module. The Query module is the safest way to do that.

    Let me know if you have any questions.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases