September 8th, 2002, 07:44 PM
getting person's ip on my server
Hello, I am using mod_python+Spyce on my server for my html pages, anyway what I wanna do is show the person's ip address so it can say something like "your ip address is: xxx.xxx.xxx.xxx" someone suggested this code:
but it gives me this error:
basicly what I am looking for is the python equivalent for <?php echo getenv("REMOTE_ADDR"); ?>
File: c:/program files/apache group/apache/htdocs/server/main.spy
Message: KeyError: REMOTE_ADDR
Stack: main.spy:80, in (main):
C:\PROGRAM FILES\PYTHON\lib\os.py:387, in __getitem__:
August 25th, 2003, 09:10 PM
there was a mistake:
this one works, i am using it in my webpage.
hope that helps
August 26th, 2003, 06:32 PM
wow you're a little late lol
August 26th, 2003, 07:08 PM
haha .. i didnt even check the date..
i was trying to do the same thing and was looking for answers from google., and i saw your post.. so i replied.. lol
i guess u have figured it out long time ago eh?
u should've posted the soln back up