• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: how can i get ip-address in guestbook (gastbuch)module   [SOLVED]
PostPosted: Wed May 25, 2005 1:43 pm 
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


Top
  
 
 Post subject: Re: how can i get ip-address in guestbook (gastbuch)module
PostPosted: Mon Jun 27, 2005 5:51 pm 
Offline
Translator
Translator

Joined: Sat Mar 12, 2005 12:30 pm
Posts: 163
Location: Vienna
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


Top
 Profile  
 
 Post subject: Re: how can i get ip-address in guestbook (gastbuch)module
PostPosted: Tue Jun 28, 2005 11:07 pm 
No problem. The reason for the ip is that i could use it against abuse.


Top
  
 
 Post subject: Re: how can i get ip-address in guestbook (gastbuch)module
PostPosted: Fri Jul 01, 2005 11:39 pm 
Offline
Translator
Translator

Joined: Sat Mar 12, 2005 12:30 pm
Posts: 163
Location: Vienna
IP adress
Create a new field in the databas
in the code on line 46 maibe
like this
Code:
absenderIP C(255),


gave a new field  a the query on case default
line444
Code:
$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())";

replaced with this
Code:
$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())";


At case defaultadmin after $absender you could write IP-Adress

and after ".$row["absender"]." you write ".$row["absenderIP"]."

hope that work not tested

kris


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner