error message for guestbook
error message for guestbook
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:
I am having trouble getting the guestbook to work. I have gone over the installation instructions 4 times. I have tried chmod and it will not allow me to change it. I have tried moving everything to my cgi-bin; that doesn't work either. Everything works until I get to where I submit the post, then I get the following error message:
Warning: fopen(entries.txt) [function.fopen]: failed to open stream: Permission denied in C:\Inetpub\wwwroot\pughcachets.com\www\gbook\gbook.php on line 438
Error
Couldn't open links file (entries.txt) for writing! Please CHMOD all entries.txt to 666 (rw-rw-rw)!
Any suggestions would be appreciated.
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:
I am having trouble getting the guestbook to work. I have gone over the installation instructions 4 times. I have tried chmod and it will not allow me to change it. I have tried moving everything to my cgi-bin; that doesn't work either. Everything works until I get to where I submit the post, then I get the following error message:
Warning: fopen(entries.txt) [function.fopen]: failed to open stream: Permission denied in C:\Inetpub\wwwroot\pughcachets.com\www\gbook\gbook.php on line 438
Error
Couldn't open links file (entries.txt) for writing! Please CHMOD all entries.txt to 666 (rw-rw-rw)!
Any suggestions would be appreciated.
Hi,
You seem to be on a Windows host?Chmod won't work there, you will have to contact your hosting company and ask them to set "world writable" permissions for entries.txt file.
Regards
You seem to be on a Windows host?Chmod won't work there, you will have to contact your hosting company and ask them to set "world writable" permissions for entries.txt file.
Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
Guestbook Notification email
Thanks! It is now posting, but I can't seem to figure out why it is not notifying me of a new entry.
I am getting the following message when an entry is added:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Inetpub\wwwroot\pughcachets.com\www\gbook\gbook.php on line 466
I am getting the following message when an entry is added:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Inetpub\wwwroot\pughcachets.com\www\gbook\gbook.php on line 466
The error message means that the sendmail_from option in the php.ini on your webserver is not set. If you have access to this file in the php directory you should open this file and set the sendmail_from option.
or
The other half of the error message suggests an error in line 466 of the gbook.php file. This could mean you have not properly changed the $settings['admin_email']="you@yourdomain.com"; setting in the settings.php file of gbook.
or
The other half of the error message suggests an error in line 466 of the gbook.php file. This could mean you have not properly changed the $settings['admin_email']="you@yourdomain.com"; setting in the settings.php file of gbook.
Guestbook email notify
Thanks, I'll check into that! But, I do believe I have the setting in the settings.php file changed. Hmmmm!
I changed the email address to post so I wouldn't be spammed. But the rest is exactly as it is in the file.
/* 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']="nancy@sbcglobal.net";
/* URL of the gbook.php file. Only required if $settings['notify'] is set to 1 */
$settings['gbook_url']="http://www.pughcachets.com/www/gbook/gbook.php";
Any ideas???
/* 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']="nancy@sbcglobal.net";
/* URL of the gbook.php file. Only required if $settings['notify'] is set to 1 */
$settings['gbook_url']="http://www.pughcachets.com/www/gbook/gbook.php";
Any ideas???
The settings you posted seem to be good.
So i think it's in your php.ini
If i'm right you're on a windows system. On my windows system i have the following settings regarding to mail in php.iniMaybe you can compare these with your settings to see if there's something wrong
So i think it's in your php.ini
If i'm right you're on a windows system. On my windows system i have the following settings regarding to mail in php.ini
Code: Select all
[mail function]
; For Win32 only.
SMTP = 192.168.2.10
smtp_port = 25
; For Win32 only.
sendmail_from = locht005@home.nl
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
No, he means the code in gbook.php, line 466 en a few lines before and after that line.
I don't know if you have modified any code in gbook.php because the error could also be there.
In gbook version 1.33 line 466 is
We would like to check if there is any change in the code that could cause the error.
I don't know if you have modified any code in gbook.php because the error could also be there.
In gbook version 1.33 line 466 is
Code: Select all
463 End of message
464 ";
465
466 mail("$settings[admin_email]","Someone has just signed your guestbook",$message);
467 }
468
469 /* Register this session variable */
470 $_SESSION['add']=1;
Still not able to make it work!
I am still struggling to make it work. Here is the code on gbook.php. I haven't changed anything, but it doesn't look like what you posted!
The "from" option has been set in the ini file and I am still getting the same message as before.
$addline = "$name$delimiter$from$delimiter$email$delimiter$url$delimiter$comments$delimiter$added$delimiter$isprivate$settings[newline]";
$fp = @fopen($settings['logfile'],"rb") or problem("Can't open the log file ($settings[logfile]) for reading! CHMOD this file to 666 (rw-rw-rw)!");
$links = @fread($fp,filesize($settings['logfile']));
fclose($fp);
$addline .= $links;
$fp = fopen($settings['logfile'],"wb") or problem("Couldn't open links file ($settings[logfile]) for writing! Please CHMOD all $settings[logfile] to 666 (rw-rw-rw)!");
fputs($fp,$addline);
fclose($fp);
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
Message (without smileys):
$comments_nosmileys
Visit the below URL to view your guestbook:
$settings[gbook_url]
End of message
";
mail("$settings[admin_email]","Someone has just signed your guestbook",$message);
}
/* Register this session variable */
$_SESSION['add']=1;
?>
<p> </p>
<p> </p>
<p><b>Your message was successfully added!</b></p>
<p><a href="gbook.php?page=1">Click here to continue</a></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<?php
printCopyHTML();
printDownHTML();
exit();
} // END addEntry
function printSign() {
global $settings;
The "from" option has been set in the ini file and I am still getting the same message as before.
$addline = "$name$delimiter$from$delimiter$email$delimiter$url$delimiter$comments$delimiter$added$delimiter$isprivate$settings[newline]";
$fp = @fopen($settings['logfile'],"rb") or problem("Can't open the log file ($settings[logfile]) for reading! CHMOD this file to 666 (rw-rw-rw)!");
$links = @fread($fp,filesize($settings['logfile']));
fclose($fp);
$addline .= $links;
$fp = fopen($settings['logfile'],"wb") or problem("Couldn't open links file ($settings[logfile]) for writing! Please CHMOD all $settings[logfile] to 666 (rw-rw-rw)!");
fputs($fp,$addline);
fclose($fp);
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
Message (without smileys):
$comments_nosmileys
Visit the below URL to view your guestbook:
$settings[gbook_url]
End of message
";
mail("$settings[admin_email]","Someone has just signed your guestbook",$message);
}
/* Register this session variable */
$_SESSION['add']=1;
?>
<p> </p>
<p> </p>
<p><b>Your message was successfully added!</b></p>
<p><a href="gbook.php?page=1">Click here to continue</a></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<?php
printCopyHTML();
printDownHTML();
exit();
} // END addEntry
function printSign() {
global $settings;
Hi Nancy,
The code you have given seems to be correct.
Try changing the code from line 466to
This sets a custom "From:" header for the mail() [function.mail]: to be used instead of the "sendmail_from" which seems to be not set in php.ini .
Let us know if this has solved your problem (or not).
Greetings,
Henrie
The code you have given seems to be correct.
Try changing the code from line 466
Code: Select all
mail("$settings[admin_email]","Someone has just signed your guestbook",$message);
Code: Select all
mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: $name <$email>\r\n");
Let us know if this has solved your problem (or not).
Greetings,
Henrie
Try setting up Apache 2.0.1 or later, its a damned sight easier and more secure.
this is a very simple guide to installing Apache.
You may want to do some more searching for apache security tutorials before unleashing your home server to the world, but its very good for a home testing server.
http://www.devshed.com/c/a/Apache/Insta ... Machine/1/
this is a very simple guide to installing Apache.
You may want to do some more searching for apache security tutorials before unleashing your home server to the world, but its very good for a home testing server.
http://www.devshed.com/c/a/Apache/Insta ... Machine/1/