Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig100 1136 posts 2523 karma points c-trib
    Dec 11, 2021 @ 12:56
    Craig100
    0

    Remote_Addr Magic String Not Working

    Umb 9.1.2 UF 9.2.0-rc001 hosted on Windows.

    I have a form which is meant to record the sender's IP address in a hidden field using "[@Remote_Addr]" as it's Default Value in the field's settings.

    This field is always empty in both the page source and the sent email.

    The form.cshtml correctly displays the IP address in text, i.e. "Your IP address will be recorded as 123.123.1.2". To get that I inject Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor and output the IP address with @HttpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString()

    Because it displays correctly on the page I suspect something is amiss with the way UF accesses it.

    Any advice would be appreciated. I'll raise an issue on GitHub if it's not just me ;)

    Rgds,

    Craig

  • Craig100 1136 posts 2523 karma points c-trib
    Dec 13, 2021 @ 20:12
Please Sign in or register to post replies

Write your reply to:

Draft