We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36649
    • 77 Posts
    Hallo,

    I'm trying to feed the registration form of WebLoginPE with the IP address of the user - unfortunately no success yet
    (in MODX Evo 1.0.6, WebLoginPE 1.3.1).

    WebLoginPE Call (shortened):
    [!WebLoginPE? ...  &type=`register` regType=`verify` ...  registerTpl=`memberRegisterVerifyFormTpl` ....  &ip_adr=`[!ipAdress!]` ... !]


    Also tried this way:
    [!ipAdress!]
    [!WebLoginPE? ...  &type=`register` regType=`verify` ...  registerTpl=`memberRegisterVerifyFormTpl` ....  !]



    The value for &ip_adr is retrieved by the snippet ipAdress:
    <?php
    return $_SERVER['REMOTE_ADDR'];
    ?>


    And last but not least - memberRegisterVerifyFormTpl looks this way:
     <form id="wlpeRegisterForm" name="wlpeRegisterForm" action="[~[*id*]~]" method="post">
        <fieldset id="wlpeRegisterFieldset" class="wlpeInputFieldset">
    <input name="ip_adr" type="hidden" value="[+ip_adr+]" />
    ....


    The form input field "ip_adr" keeps remaining emtpy ...

    Thanks for any hint!!

    This question has been answered by hgw7m. See the first response.

    [ed. note: hgw7m last edited this post 12 years, 7 months ago.]
    • discuss.answer
      • 36649
      • 77 Posts
      Answer to myself, and maybe it's helpful for others, too.

      I wasn't aware that the placeholder value has to be defined in the snippet. So in the snippet you can declare:

      // define the placeholder and set it's value
      $modx->setPlaceholder('placeholderName',$value);
      


      It's an old and basic thread, but seems I never stumbled upon:
      https://forums.modx.com/thread/20015/how-to-guide-for-writing-snippets-using-chunks-and-placeholders