IP field in FomidableAnswerSets

Permalink Browser Info Environment
We are hosting our concrete5 installation behind caching servers. After completing the form and submitting, we were getting a 500 error. After further checking, Formidable was grabbing two IPs -- from the client and one of the caching servers. Because the size of the IP field is only 15, this caused a SQL error on the insert. We increased the size of the IP field to correct the issue.

The question: why is formidable grabbing both IPs? Or how can we configure formidable to run in a cached environment?

My concern is that I will forget this little gem if we ever have to update/upgraded Formidable.

Thank you for your time.

Type: Pre-Sale
Status: Resolved
Aminie
View Replies:
DeWebmakers replied on at Permalink Reply
DeWebmakers
Hi,

Sorry for the late reply!
Not sure why there are 2 IP's grabbed.

The code to determine the submitter is this:
private function get_ip() {
      $ip = $_SERVER['REMOTE_ADDR'];    
      if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
         $ip = $_SERVER['HTTP_CLIENT_IP'];
      } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
      }    
      return $ip;
   }

Why ip produces 2 IP's isn't clear to me...

I'll change the max length in the DB. So if you update this won't be an issue.. :)

Best,

Corretje

concrete5 Environment Information

# concrete5 Version
5.6.3.1

# concrete5 Packages
Formidable (2.0.11), SOS Snippets (0.04), SOS Theme (1.20.1), Toolbar Button (1.0.2).

# concrete5 Overrides
blocks/content, elements/editor_controls.php, languages/it_IT, languages/de_DE, languages/el_GR, languages/da_DK, languages/tr_TR, languages/sl_SI, languages/vi_VN, languages/zh_TW, languages/fa_IR, languages/zh_CN, languages/es_ES, languages/ja_JP, languages/es_PE, languages/sk_SK, languages/he_IL, languages/es_MX, languages/fi_FI, languages/cs_CZ, languages/nl_NL, languages/ru_RU, languages/sv_SE, languages/es_AR, languages/nb_NO, languages/fr_FR, languages/pt_PT, languages/ro_RO, languages/ar, libraries/tinymce, models/application_cache.php, single_pages/page_not_found-bu.php, single_pages/page_not_found.php

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - Off
Full Page Caching - Off

# Server Software
Apache/2.2.3 (Red Hat)

# Server API
apache2handler

# PHP Version
5.4.32

# PHP Extensions
apache2handler, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, json, ldap, libxml, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, Reflection, session, shmop, SimpleXML, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 2M
ldap.max_links - Unlimited
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.