Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 02-07-2015 14:52:13

timberguy
Member
Registered: 01-14-2008
Posts: 140

I.P. address included in Contact forms.

How can we include the senders I.P. address in the contact form message sent to the site owner?

Offline

 

#2 02-11-2015 15:20:19

timberguy
Member
Registered: 01-14-2008
Posts: 140

Re: I.P. address included in Contact forms.

Knock Knock  wink

Offline

 

#3 02-12-2015 10:18:08

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19514
Website

Re: I.P. address included in Contact forms.

Edit the mail message under System > Mail > Mail Messages and include something like:

IP Address: <?php print $_SERVER['REMOTE_ADDR']; ?>


Nick Hendler

Offline

 

#4 02-13-2015 10:44:34

timberguy
Member
Registered: 01-14-2008
Posts: 140

Re: I.P. address included in Contact forms.

I've tried several different ways and always get after trying to send:

There was an error encountered when trying to send your email message. Perhaps an invalid email address was entered. Please try again.

Offline

 

#5 02-13-2015 15:01:43

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1642
Website

Re: I.P. address included in Contact forms.

it should be
IP Address: <?php print $_SERVER['REMOTE_ADDR']; ?>


- Euorpacart 8

Offline

 

#6 02-13-2015 23:57:19

timberguy
Member
Registered: 01-14-2008
Posts: 140

Re: I.P. address included in Contact forms.

The extra bracket was the culprit. Thank you! It works now.

Offline

 

#7 02-20-2015 10:59:45

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19514
Website

Re: I.P. address included in Contact forms.

Sorry, I fixed the syntax in my post.


Nick Hendler

Offline

 

#8 11-01-2017 12:59:19

timberguy
Member
Registered: 01-14-2008
Posts: 140

Re: I.P. address included in Contact forms.

I have the same question for a different instance. Wondering how to include this in a dynamic form like a customer feedback form.

Last edited by timberguy (11-01-2017 13:00:07)

Offline

 

#9 11-02-2017 07:59:28

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19514
Website

Re: I.P. address included in Contact forms.

Doing this for a dynamic for requires editing the {private}/apps/cms/CMS_Dynforn/CMS_Dynform.php class.  There you will find the function dynform_proc().  In that function, you will see the submitted values being added to the mail in the block commented with:

Code:

// +--
// | Check out our required fields and build onto our message.
// +--

Right after that code block (after the surrounding foreach closes) add:

Code:

$plaintext .= 'IP Address:' . $eol . $_SERVER['REMOTE_ADDR'] . $eol . $eol;

if ($sendxhtml) {

          $xhtmltext .= '<p><strong>IP Address</strong></p>' . $eol;
          $xhtmltext .= '<p>' . $this->CORE_Display->xhtml_encode($_SERVER['REMOTE_ADDR']) . '</p>' . $eol . $eol;

} // End of if statement.

Nick Hendler

Offline

 

#10 11-02-2017 18:23:00

timberguy
Member
Registered: 01-14-2008
Posts: 140

Re: I.P. address included in Contact forms.

Got it Nick!  Thank you!

Offline

 

Board footer