Page 1 of 1

Deleting Posts Problem

Posted: Mon Apr 25, 2005 7:30 am
by DougD
Hi,

First of all... I really like the script! I am however having a small glitch that I do not know how to fix. I am creating a web site for a friend of mine and have added your guestbook script. It works great for posting, but if I try and delete one post, it erases all the posts and leaves me with the word "Array" in all the other posts (see: http://www.miramesa.com/SanDieguito/guestbook/gbook.php)

I read a similar sort of post below, and it said:
I suggest you DELETE the entire entries.txt file from the server and transfer the original (empty) one back. Make sure you transfer it in ASCII mode, and don't forget to set CHMOD 666.
I did that, and tried reposting and deleting and the same thing happened again.

Any other idea on how to fix this?

Thanks a lot...

Doug

Posted: Mon Apr 25, 2005 9:37 am
by Klemen
Hi,

Have you been editing gbook.php script?

Try this:

- delete entries.txt
- what is your $settings['system'] in settings.php set to? Try changing it to 1 or 2
- test

If that doesn't work set $settings['system']=1 and delete entires.txt, upload new one and change your admin password to "admin" so I can test it.

Regards

Posted: Mon Apr 25, 2005 4:38 pm
by DougD
Hi,

No, I have not modified any part of the script.

Ok... I did everything you asked in your post and still got the same results. So, I now switched it back to "1", changed the password, sent a blank "entries.txt", and posted a new entry so you can test.

Thanks a lot for your help...

Doug

Posted: Mon Apr 25, 2005 8:22 pm
by Klemen
Hi,

Not sure what could be wrong. Perhaps this is a bug in the script, try setting this in your settings.php file:

Code: Select all

$settings['add_to']=1; 
and then try deleting a post. If it works ok then this is a bug in the script and I will check it out.

Regards

Posted: Mon Apr 25, 2005 8:35 pm
by DougD
Hi Klemen,

You just wanted me to add that line

Code: Select all

($settings['add_to']=1;)
to the script... correct? I did not see a "add_to" line in the script anywhere to set, so I just added it. I hope that is what you meant.

I did that and uploaded the file and still have the same results.

Any other ideas?

Thanks,

Doug

Posted: Mon Apr 25, 2005 8:59 pm
by DougD
Hmmm... I think it must be a server issue.

I took the exact same files and added them to a site on another server and it is working fine!

see: http://www.skateboardwear.com/guestbook/

Any idea what could be wrong? Both servers are Unix and have the same software installed.

Thanks,

Doug

Posted: Tue Apr 26, 2005 8:10 am
by Klemen
Hi,

The $settings['add_to']=1; is located in your settings.php file, yours is probably set to $settings['add_to']=0; SO try setting that to 1 on the server that has problems.

I have no idea why it wouldn't work on one of your servers, but works ok on another. Sorry, can't help you here as I really don't know much about setting servers :(

Regards

Posted: Tue Apr 26, 2005 5:22 pm
by DougD
Hi Klemen,

It is probably there, but I just cannot see it. I downloaded another version just to make sure that I didn't delete it on my site. I do not see

Code: Select all

$settings['add_to']=0;
in the settings.php file anywhere. Am I missing something?


setting.php code below

Code: Select all

<?php
/* >>> SETUP YOUR GUESTBOOK <<< */
/* Detailed information found in the readme file */

/* What type of server is your website on?
 1 = UNIX (Linux), 2 = Windows, 3 = Machintos */
$settings['system']=1;

/* Password for admin area */
$settings['apass']="admin";

/* Website title */
$settings['website_title']="My lovely website";

/* Website URL */
$settings['website_url']="http://www.domain.com/";

/* Guestbook title */
$settings['gbook_title']="My lovely website - guestbook";

/* Allow smileys? 1 = YES, 0 = NO */
$settings['smileys']=1;

/* 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']="you@yourdomain.com";

/* URL of the gbook.php file. Only required if $settings['notify'] is set to 1 */
$settings['gbook_url']="http://www.domain.com/guestbook/gbook.php";

/* Filter bad words? 1 = YES, 0 = NO */
$settings['filter']=1;

/* Filter language. Please refer to readme for info on how to add more bad words
to the list! */
$settings['filter_lang']="en";

/* Prevent automated submissions (SPAM)? 1 = YES, 0 = NO */
$settings['autosubmit']=1;


/* >>> OPTIONAL SETTINGS <<< */

/* Name of the file where guestbook entries will be stored */
$settings['logfile']="entries.txt";



/* >>> DO NOT EDIT BELOW <<< */
$settings['verzija']="1.3.2";
?>
Thanks,

Doug

Posted: Tue Apr 26, 2005 5:49 pm
by Klemen
Hi,

Sorry, I was looking at the wrong script settings.php, silly me :oops:

To be honest I don't really know what is wrong, but my guess is if it works ok on one of your servers then it must be the server fault if it doesn't work on the other one?

Sorry I can't be of more help here.

Regards

Posted: Tue Apr 26, 2005 5:57 pm
by DougD
I am glad I was not going blind :P

That's ok! I appreciate your help and the cool script.

I will be moving it over to my friend's server which is different anyway... so hopefully it will work on there. If not, I will just use the server it works on!

Thanks again...

Doug