Hello I'm a real newbe when it comes to php. But maybe theres someone who can help me out. I'd like to be able to get the ip of te person who added an item to the guestbook.
This is what i have so far:
$domain = GetHostByName($REMOTE_ADDR);
This should get the ip but i dont know where to put the line.
in the line:
@mail("$e_mailnoti" , "$e_mailnotibetr", "$e_mailnotimessage:
$_POST[message]
homepage:$_POST[homepage]
ip:$domain
");
Well... I think i'm thinking much too simple with this, but you gotta start somwhere.
Is there's someone who can help me!
Thanks in advance!
Erik
how can i get ip-address in guestbook (gastbuch)module
-
- Translator
- Posts: 169
- Joined: Sat Mar 12, 2005 12:30 pm
- Location: Vienna
Re: how can i get ip-address in guestbook (gastbuch)module
Hi erik
I am sorry that you are waiting so long vor an reply but no time.
What do you want to do with the ip adress of the client?
Kris
I am sorry that you are waiting so long vor an reply but no time.
What do you want to do with the ip adress of the client?
Kris
Re: how can i get ip-address in guestbook (gastbuch)module
No problem. The reason for the ip is that i could use it against abuse.
-
- Translator
- Posts: 169
- Joined: Sat Mar 12, 2005 12:30 pm
- Location: Vienna
Re: how can i get ip-address in guestbook (gastbuch)module
IP adress
Create a new field in the databas
in the code on line 46 maibe
like this
gave a new field a the query on case default
line444
replaced with this
At case defaultadmin after $absender you could write IP-Adress
and after ".$row["absender"]." you write ".$row["absenderIP"]."
hope that work not tested
kris
Create a new field in the databas
in the code on line 46 maibe
like this
Code: Select all
absenderIP C(255),
line444
Code: Select all
$query="INSERT INTO ";
$query .= cms_db_prefix()."module_gastbuch";
$query .=" (absender, e_mail, homepage, message, datum) values ('".$_POST[absender]."', '".$_POST[betreff]."', '".$_POST[homepage]."', '".$_POST[message]."', now())";
Code: Select all
$query="INSERT INTO ";
$query .= cms_db_prefix()."module_gastbuch";
$query .=" (absender, absenderIP, e_mail, homepage, message, datum) values ('".$_POST[absender]."', '".$_SERVER[REMOTE_ADDR]."', '".$_POST[betreff]."', '".$_POST[homepage]."', '".$_POST[message]."', now())";
and after ".$row["absender"]." you write ".$row["absenderIP"]."
hope that work not tested
kris