IP adress

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
ethome

IP adress

Post 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
ethome

Re: IP adress

Post 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
Traveller

Post 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
DaDon
Posts: 3
Joined: Sat Oct 15, 2005 12:00 am

Post 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?
Guest

Post 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.
Guest

Post 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.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

AND thanks to all posting here and helping others :D
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Rasmus

Post 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
Post Reply