I sell alot of online items and Can use this form to better orgainze when someone makes a purchase from me as to what item it was, there email, phone number etc. I have created a form but was wondering if its possible to Track the persons IP address when they suubmit the form?
I am not very "code" oriented, I had my buddy host my form I made for me and its already to be used, But i am wanting to get a persons IP when they submit the form.
If anyone can let me know what to type and where to put it, that would be greatly appreciated!
Andy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are two ways to accomplish this.
1.) Change the form.html to form.php and add a variable to the form that catures the IP address. Then pass this value to the processor.php just like any other variable.
2.) Change the processor.php file to capture the IP address and add the new variable to your email message, db, or whatever you are using to store the data.
For option 2, this is the varaible assignment you need to use to get the IP address.
$ipaddress=$_SERVER['REMOTE_ADDR'];
Add the $ipaddress variable to your data storage task (email, db, etc).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#1 - try not to include any private information in your posts. I can handle the omittion of this data. If necessary I will ask that you send it vcia email to preserve privacy.
Hi,
I sell alot of online items and Can use this form to better orgainze when someone makes a purchase from me as to what item it was, there email, phone number etc. I have created a form but was wondering if its possible to Track the persons IP address when they suubmit the form?
I am not very "code" oriented, I had my buddy host my form I made for me and its already to be used, But i am wanting to get a persons IP when they submit the form.
If anyone can let me know what to type and where to put it, that would be greatly appreciated!
Andy
There are two ways to accomplish this.
1.) Change the form.html to form.php and add a variable to the form that catures the IP address. Then pass this value to the processor.php just like any other variable.
2.) Change the processor.php file to capture the IP address and add the new variable to your email message, db, or whatever you are using to store the data.
For option 2, this is the varaible assignment you need to use to get the IP address.
$ipaddress=$_SERVER['REMOTE_ADDR'];
Add the $ipaddress variable to your data storage task (email, db, etc).
Hi there -- I'm Duffz "Friend" whom is helping him with his form and I'm still having troubles having it send to his e-mail.
I'll post his processor.php here:
<?php
$where_form_is="http://www.abirminghamverify.com/form.html".$_SERVER['SE
RVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
$ipaddress=$_SERVER['REMOTE_ADDR'];
mail("andy@abirminghamverify.com","phpFormGenerator - Form
submission","Form data:
Phone Number:: " . $_POST['field_1'] . "
Paypal
E-mail Address:: " . $_POST['field_2'] . "
eBay User ID:: " . $_POST['field_3'] . "
Item(s) Purchased:: " . $_POST['field_4'] . "
powered by
phpFormGenerator.
");
include("confirm.html");
?>
If there is any mistakes please point them out!
#1 - try not to include any private information in your posts. I can handle the omittion of this data. If necessary I will ask that you send it vcia email to preserve privacy.
Reduce your process.php to this:
<?php
$ipaddress=$_SERVER['REMOTE_ADDR'];
mail("andy@abirminghamverify.com","phpFormGenerator - Form submission",
"Form data:
Phone Number:: " . $_POST['field_1'] . "
Paypal E-mail Address:: " . $_POST['field_2'] . "
eBay User ID:: " . $_POST['field_3'] . "
Item(s) Purchased:: " . $_POST['field_4'] . "
IPAddress:: " . $ipaddress . "
");
?>
It should work.
Nope -- didn't work :(
Is there something I have to do in the control panel at www.godaddy.com?
That's where it's being hosted.
On a free economy server or whatever they are.