Page 1 of 1
IP adress
Posted: Tue Oct 11, 2005 8:02 pm
by ethome
Script URL:
Version of script:
Version of PHP:
Hosting company:
Have you searched THIS FORUM for your problem:
(if not please do before posting)
If so, what terms did you try:
Write your message below:
Is there a way of retreiving an Ip adress from someone that has send an entry in the gbook
Like the gbook very much
Thanks E.T
Re: IP adress
Posted: Tue Oct 11, 2005 8:12 pm
by ethome
ethome wrote:Script URL:
Version of script:
Version of PHP:
Hosting company:
Have you searched THIS FORUM for your problem:
(if not please do before posting)
If so, what terms did you try:
Write your message below:
Is there a way of retreiving an Ip adress from someone that has send an entry in the gbook
Like the gbook very much
Thanks E.T
Sorry was sleeping I found where I was looking for
Cheers
Posted: Tue Oct 11, 2005 8:51 pm
by Traveller
Hi,
Find
if ($settings['notify'] == 1)
{
$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$message = "Hello!
Someone has just signed your guestbook!
Name: $name
From: $from
E-mail: $email
Website: $url
and replace with
if ($settings['notify'] == 1)
{
$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$IP = $_SERVER["REMOTE_ADDR"];
$message = "Hello!
Someone has just signed your guestbook!
Name: $name
From: $from
E-mail: $email
Website: $url
IP: $IP
this will send you the ip of a gbook submission if you have your send reply email settings set to 1
Kiss
Posted: Sat Oct 15, 2005 1:13 am
by DaDon
That worked for me!
One novice type question: how do I send that ip address to the mySQL database version of this guestbook script?
Posted: Wed Nov 16, 2005 10:12 am
by Guest
Traveller wrote:Hi,
Find
if ($settings['notify'] == 1)
{
$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$message = "Hello!
Someone has just signed your guestbook!
Name: $name
From: $from
E-mail: $email
Website: $url
and replace with
if ($settings['notify'] == 1)
{
$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$IP = $_SERVER["REMOTE_ADDR"];
$message = "Hello!
Someone has just signed your guestbook!
Name: $name
From: $from
E-mail: $email
Website: $url
IP: $IP
this will send you the ip of a gbook submission if you have your send reply email settings set to 1
Kiss
GBook:
Version: 1.33
PHP: 4
Excellent script guys, but I have a problem, in where exactly to add the above code.
Okay I searched the forum, as requested, and yet being a total novice, tried to insert the above code only to get a parsing error.
EG:
/* Send you an e-mail when a new entry is added? 1 = YES, 0 =
NO */
$settings['notify']=1;
/* Your e-mail. Only required if $settings['notify'] is set to
1 */
$settings['admin_email']="
yourdomain@domain.com";
/* URL of the gbook.php file. Only required if
$settings['notify'] is set to 1 */
$settings['gbook_url']="
http://www.yourdomain/guestbook/gbook.
php";
Now I noticed you have written:
if ($settings['notify'] == 1)
Whereas in my settings.php file (before I tried your alteration) it read:
$settings['notify']=1;
Any help, for this novice, would be totally appreciated.
Posted: Wed Nov 16, 2005 10:45 am
by Guest
Sorry guys, my ignorance of php showed through with my above post.
I have now got my Gbook script fixed.
Thanks Klemen, for such a wonderful script.
Posted: Wed Nov 16, 2005 12:00 pm
by Klemen
AND thanks to all posting here and helping others

Posted: Sat Nov 26, 2005 9:13 am
by Rasmus
Hi.
After i changed the code i did't get the messaged in the e-mail i recived after person had signed in the guest book.
I use this code insted!
if ($settings['notify'] == 1)
{
$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$IP = $_SERVER["REMOTE_ADDR"];
$message = "Hello!
A person has wrote a messaged in the guestbook
Name: $name
From: $from
E-mail: $email
Website: $url
IP: $IP
Message (without smileys):
$comments_nosmileys
Go to the guestbook:
$settings[gbook_url]
End of message
";
mail("$settings[admin_email]","A person has wrote a messaged in the guestbook",$message);
}
/* Register this session variable */
$_SESSION['add']=1;
?>
Hope you can use it.
Rasmus