RE: Changing IP Names

greenspun.com : LUSENET : S-Mart Shopping Cart : One Thread

Okay,

I have an idea of how I can fix the problem of the cart sometimes seeing the "domain" IP (ppp114.blahblah.com) and sometimes seeing the IP address (123.123.123.114), but I am not sure how to do it. I am pretty sure it is a server related thing since I didn't have this problem before I moved servers, but there should be a way around it. The line that gets the IP for the user for the cart name:

$host = $ENV{'REMOTE_HOST'};

Is there a way to make that always use the physical numbers...another words convert it to physical numbers all the time instead of whatever the server gives it? I am not familiar enough with CGI or Perl to really know how this is done. Does anyone out there have any ideas. I think if I can tell it that every time it wants the REMOTE_HOST it should use the 124.124.124.114 instead of the ppp114.blahblah.com IP it would work correctly. I have determined that the substitution is totally random, just occurs once in a while...and never in the same spot in the script. By converting it to straight IP numbers every time, then no matter what it comes up with from the server it will always be the same. Any suggestions would be great. Hopefully someone knows how this would be done.

Thanks In Advance,

William Deniston bill@pages2go.com

-- William Deniston (bill@pages2go.com), November 25, 1998

Answers

Replace REMOTE_HOST with REMOTE_ADDR

This should fix the problem.

Bye, JS

-- Jeremy Smith (pancakepan@usa.net), November 28, 1998.


I have implemented cookies with my cart. If you are interested to know more, email me at patrickccf@hotmail.com.

--
God bless!

-- Patrick Chan (patrickccf@hotmail.com), March 20, 2000.


Moderation questions? read the FAQ