URL: http://www.uburst.com/cgi-bin/dcforum/dcboard.cgi
Forum: ushp_general_purpose
Thread Number: 360
[ Go back to previous page ]

Original Message
"IP Adress in e-Mail Confirmation"

Posted by ralf schwab [ralf.schwab@friseurversand.com] on at 04:42 AM
Hello,

i have integrated in the customer e-mail order
confirmation the IP Adress.
The following code was integrated by me in the ushop.cgi:

$order_footer = &get_cart_html();
if (($settings[71] =~ /\S/) && ($settings[71] ne "NONE"))
{
$order_footer .= &substitute_key_fields($settings[71]);
}
if (($REMOTE_ADDR =~ /\S/) && ($REMOTE_ADDR ne "Nicht festgestellt"))
{
$order_footer .= "(Sicherheits-Check: Wir haben Ihre PC-INTERNET-ADRESSE aufgezeichnet.
Die Bestellung kam von folgendem Computer: : $REMOTE_ADDR ";
}

Now my Question:
I recieve in the e-mails as IP Adress allways
the same Number (195.20.224.126).
I have installed the ushop.cgi script in a SSL
Secured Directory is this perhaps the reason
for the same ip-adress ?

with best regards

schwab ralf


Table of contents

Messages in this discussion
"RE: IP Adress in e-Mail Confirmation"
Posted by Bill Weiner on at 05:15 AM
The $REMOTE_ADDR is the same for all of your customers? (Not just your testing?)

Are you using any external payment processing system to collect the payment information and then transfer back to the uShop CGI script? If not, then it may just be something with how your server is setting the REMOTE_ADDR environment variable.


"external script ? yes"
Posted by ralf schwab [ralf.schwab@friseurversand.com] on at 12:50 PM
Hi Bill,

in deed !
I have installed a cgi-script in my ssl directory,
which collects (via SSL secured connection), the
creditcard data - but ONLY the creditcard-data.
All other payment methods (POD,ADVANCE PAY,Innovice....)
use NOT the cgi-script.
But i think that makes the same ip - but why ?

best regards
schwab ralf


"RE: external script ? yes"
Posted by Bill Weiner on at 05:16 AM
What's probably happening is that since all credit card transactions are going through that other CGI script... it's that CGI script's IP that you are always getting.

What may have to be done in order to get the customer's $REMOTE_ADDR is to obtain and save the customer's $REMOTE_ADDR before the credit card transaction script is run. I'm not sure exactly how you're interfacing with the other script, but here are a couple suggestions:

1) Obtain the customer's REMOTE_ADDR before transferring to your credit card transaction script. The REMOTE_ADDR can be obtained with the following line of Perl code:

$REMOTE_ADDR = $ENV{'REMOTE_ADDR'};

2) Save the $REMOTE_ADDR in a temporary file or, if the credit card transaction script will pass variables through for you, pass it as a parameter to your credit card transaction script.

3) In uShop's "complete_order" subroutine, re-obtain the $REMOTE_ADDR from whatever method use used to save it in step 2 above.

Again, I can't give you complete instructions since I don't know exactly how your setup is... but maybe this will give you some ideas?


"IP Adress"
Posted by ralf schwab [ralf.schwab@friseurversand.com] on at 02:50 AM
Hello Bill,

i understand that the REMOTE_ADDR is taken from
the e-Mail CGI-Script in our SSL directory.
But, what i don`t understand is, why the
REMOTE_ADDR is taken if you dont use the SSL
secured CGI-Script. We use this script only if
a customer pays via Credit-Card. On the order
review page i have integrated a link to the
Script Url.
This script is not used by other payment methods.

Perhaps the same IP depends on the URL of our
Ushop.cgi, which is located at:
https://ssl.kundenserver.de/ssl.friseurversand.com/ushopd/ushop.cgi
My shopping site is located at http://www.friseurversand.com

Is this the reason therefore ?

With best regards

schwab ralf


"RE: IP Adress"
Posted by Bill Weiner on at 05:24 AM
The REMOTE_ADDR is the IP address of the remote host making the request. Typically, this will be user's browser making the request, so the REMOTE_ADDR will be set to the IP address of the user... or rather the IP address of the user's connection through his/her Internet Service Provider. In cases where the request comes from another CGI script/application that redirects or POSTs the request, then the REMOTE_ADDR would be set to that of the other CGI script/application (This is often the case of external payment processing systems redirecting or POSTing their approved/denied response back to the uShop CGI script.)

Now, if you are saying that the IP address being recorded as the REMOTE_ADDR is the same regardless of whether the customer utilized your external payment processing system... or just utilized one of the standard uShop payment options... then there is probably some application/service setup on your server that the requests are first being sent through. You could probably verify that with your Web Hosting Provider.... and/or by doing some tests yourself. One such test might be to utilize the $REMOTE_ADDR = $ENV{'REMOTE_ADDR'}; (described in my previous post) to obtain/display the $REMOTE_ADDR at a different point in the order process... like perhaps on the "display_review_order_form" subroutine, which would normally be displayed directly from the user's request after filling out the first order form and pressing the "Continue" button. Another test might be to just add the lines:

$REMOTE_ADDR = $ENV{'REMOTE_ADDR'};
print "$REMOTE_ADDR";

... to the "cgitest.pl" script that came with uShop. See if the IP address is always the same there.

But again, you may be able to confirm with your Web Hosting Provider if requests on your server are being redirected through some application/service such that the REMOTE_ADDR is always being set to the same value.


"REMOTE_ADRESS ..."
Posted by ralf schwab [ralf.schwab@friseurversand.com] on at 02:51 PM
Hi Bill,

now i know why i get always the same ip-adress (in my order-confirmation).
I have installed the GERMAN ushop.cgi in a SSL
Directory that the User see the whole Order
Process is 128-bit secured (Lock Symbol in the
Browser).
My ENGLISH ushop.cgi is in a "normal" Directory
The English orders are all with the correct IP
Adress of the user - so the problem is the SSL
Directory.
Is there a way to get the IP Adress BEVORE the
User starts the ushop.cgi, save it and insert
it then in the order confirmation ?

with best regards

schwab ralf
www.friseurversand.com


"RE: REMOTE_ADRESS ..."
Posted by Bill Weiner on at 04:28 AM
I don't know of any way to get the IP address of the user via Java or JavaScript. What you could try doing is writing your own CGI script that gets the IP address, stores it as a cookie, and then later have your uShop CGI script read the cookie. Perhaps use the "cookies.pl" script that comes with uShop as an example.

Probably the easiest thing to do, however, is to just figure out why your SSL server is not setting the REMOTE_ADDR environment variable. That's got to be some sort of server setting.


"IP Adress in e-Mail Confirmation "
Posted by Sommay [info@blackchips.com] on at 09:20 PM
Hi Bill

I also would like to add IP Adress in e-Mail Confirmation and also for the Order Number to appear in the eMail subject line. I'm using the New uShop 3.6 Authorize.Net SIM Interface


"RE: IP Adress in e-Mail Confirmation"
Posted by Bill Weiner on at 07:35 AM
For uShop 3.5 or 3.6:

INSTRUCTIONS TO ADD THE IP ADDRESS TO THE EMAIL CONFIRMATION
------------------------------------------------------------

STEP 1: Make a backup of your current ushop.pl script... just in case.

STEP 2: Open your ushop.pl script with any text editor such as WordPad.

STEP 3: Do a search on the following line:

$receipt_text = &get_receipt_text("YES");

STEP 4: Immediately AFTER that line, add these two lines:

$REMOTE_ADDR = $ENV{'REMOTE_ADDR'};
$receipt_text .= "\nIP Address = $REMOTE_ADDR\n";

STEP 5: Save the script ... as TEXT if your editor asks... and try it out!


INSTRUCTIONS TO ADD THE ORDER NUMBER TO THE SUBJECT OF THE EMAIL CONFIRMATION
-----------------------------------------------------------------------------

STEP 1: Make a backup of your current ushop.pl script... just in case.

STEP 2: Open your ushop.pl script with any text editor such as WordPad.

STEP 3: Do a search on the following line:

$receipt_text = &get_receipt_text("YES");

STEP 4: Immediately AFTER that line, add these two lines:

$settings[7] .= "($order_number)";
$settings[8] .= "($order_number)";

STEP 5: Save the script ... as TEXT if your editor asks... and try it out!



"ORDER NUMBER TO THE SUBJECT"
Posted by Sommay [info@blackchips.com] on at 00:28 AM
Hi Bill, I added the following instruction:


$receipt_text = &get_receipt_text("YES");
$settings[7] .= "($order_number)";
$settings[8] .= "($order_number)";
$REMOTE_ADDR = $ENV{'REMOTE_ADDR'};
$receipt_text .= "\nIP Address = $REMOTE_ADDR\n";

Both are now working however I am receiving Order Notification twice and the IP address appear at the bottom of the eMail message.

I would like to receive only one Order Notification and have the IP address appear on top of the eMail message, just above the order number. Note: My customer only received single Order Receipt, which is what I wanted.

Thank you very much


"ORDER NUMBER TO THE SUBJECT"
Posted by Microburst Support Team [support@uburst.com] on at 06:34 AM
If you are receiving the order notification twice, check your settings in the uShop Control Panel - it sounds like you have set up both a primary and secondary email address (either both emails are ones that you check, or they are both identical) to be notified of the order. Go ahead and e-mail us a diagnostic report (support@uburst.com) if this is not the case.

If you want the IP address on top of the email message, rather than at the bottom, change your logic above to be like this instead:

$receipt_text = "\nIP Address = $REMOTE_ADDR\n";
$temp_receipt_text = &get_receipt_text("YES");
$receipt_text .= $temp_receipt_text;
$settings[7] .= "($order_number)";
$settings[8] .= "($order_number)";
$REMOTE_ADDR = $ENV{'REMOTE_ADDR'};


"IP Address"
Posted by Sommay [info@blackchips.com] on at 10:58 PM
Its working! Thank you...

I did have both primary and secondary email identical addresses


"Same IP address display"
Posted by Sommay [info@blackchips.com] on at 09:13 PM
The IP address does appear the way I want, but I just noticed the three fixed IP appear in every order notification, here are the three IP: 64.94.118.192, 64.94.118.193 and 64.94.118.195

I have no idea who IP this is


"RE: Same IP address display"
Posted by Bill Weiner on at 06:52 AM
Do you mean that on all of your orders, one of those three IP addresses shows up as the user's IP address?

If so, are you interfacing with any payment processing system? (The IP address could just always be from the payment processing system.)

Or perhaps there is some additional relay to your server that is aways resulting in the same referrer IP?


"Same IP addresses on every order!"
Posted by Sommay [info@blackchips.com] on at 05:12 PM
1. The three IP addresses shows up as the user's IP address on every order.

2. We are using uShop 3.60, authorizenet.com for payment processing system.

What do I need to do to solve this problem?
Sommay


"IP address"
Posted by Sommay [info@blakchips.com] on at 03:10 PM
I'm still waiting for your reply on how to solve the problem above

Sommay


"IP Address"
Posted by Microburst Support [support@uburst.com] on at 09:55 AM
The REMOTE_ADDR is the IP address of the remote host making the request. Typically, this will be user's browser making the request, so the REMOTE_ADDR will be set to the IP address of the user... or rather the IP address of the user's connection through his/her Internet Service Provider. In cases where the request comes from another CGI script/application that redirects or POSTs the request, then the REMOTE_ADDR would be set to that of the other CGI script/application (This is often the case of external payment processing systems redirecting or POSTing their approved/denied response back to the uShop CGI script.)

What may have to be done in order to get the customer's $REMOTE_ADDR is to obtain and save the customer's $REMOTE_ADDR before the credit card transaction script is run.
1) Obtain the customer's REMOTE_ADDR before transferring to your credit card transaction script. The REMOTE_ADDR can be obtained with the following line of Perl code:
$REMOTE_ADDR = $ENV{'REMOTE_ADDR'};
2) Save the $REMOTE_ADDR in a temporary file or, if the credit card transaction script will pass variables through for you, pass it as a parameter to your credit card transaction script.
3) In uShop's "complete_order" subroutine, re-obtain the $REMOTE_ADDR from whatever method use used to save it in step 2 above.