Jump to:

1999 Posts in 1408 Topics by 613 members

Form Questions

SilverStripe Forums » Form Questions » Adding visitor IP capture to User Forms

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1299 Views
  • raZbi
    Avatar
    Community Member
    11 Posts

    Adding visitor IP capture to User Forms Link to this post

    Hi,

    Trying to capture IP address of visitor on form submission. Have added hidden field, called 'IPaddreess' to form, but stucked with applying any value to that field. Here's what i'm trying to add to UserDefinedForm.php:

    if($submittedField->Name == 'IPaddress') {
    $submittedField->Value = 'Test';   
    }

    Either code is wrong, or i'm applying it at the wrong place, have inserted it right after

    $submittedField = $field->getSubmittedFormField();
    $submittedField->ParentID = $submittedForm->ID;
    $submittedField->Name = $field->Name;
    $submittedField->Title = $field->Title;

    Any ideas?

    1299 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.