Return IP address in email from simple form?

I have a form that someone else did and I am asked to change it so the form results that are emailed back from the form have the IP address of the User.

I know nothing about coding php. I see examples of this code:

$message .= "User’s IP: ". $userip;

but dont have a clue where to put the code in the form.

The form itself is easy to read in the code. But this part I’m not sure of, AND if this is where the USERIP line would go?:
(starting with the end of form code)

<?php }
	elseif($status == 'send')
		$Name = ($_POST['Name']);
		$Email = ($_POST['Email']);
		$Company = ($_POST['Company']);
		$Street = ($_POST['Street']);
		$City = ($_POST['City']);
		$State = ($_POST['State']);
		$Zip = ($_POST['Zip']);
		$Where = ($_POST['Where']);
		$Message = ($_POST['Message']);

$myemail = "[email protected]";
$subject = “Message from Email Form”;
$message = "The following message was sent from the Contact Page:

NAME: $Name
EMAIL: $Email
COMPANY: $Company

$City, $State $Zip


MESSAGE: $Message";

mail($myemail, $subject, $message);

echo"Thank you. Your email has been sent.";

If I need to post the entire form, just let me know!! Thank you in advance!

below the line $Message = ($_POST[‘Message’], add the following line


and below the line MESSAGE: $Message";, add the following line…

$message .= "User’s IP: ". $userip;

that will do…

Sponsor our Newsletter | Privacy Policy | Terms of Service