Jump to content

Broken PHP guestbook


Tymochenko

Recommended Posts

I have a website which has PHP coded guestbook, and some days ago the guestbook "broke". I don't know anything about coding with PHP so I thought I might get some help here. The previous owner of the website made the guestbook from the code she got from a friend (who's not her friend anymore so she can't ask help from them).

 

Here's the guestbook with problem: http://uusilegenda.net/vieraskirja

 

As you can see, it's messed up with notices all over the place.

 

Notice: Use of undefined constant otsikko - assumed 'otsikko' in /var/www/virtual/uusilegenda.net/htdocs/vieraskirja/index.php on line 37

 

Notice: Use of undefined constant viesti - assumed 'viesti' in /var/www/virtual/uusilegenda.net/htdocs/vieraskirja/index.php on line 41 Notice: Use of undefined constant lahettajan_nimi - assumed 'lahettajan_nimi' in /var/www/virtual/uusilegenda.net/htdocs/vieraskirja/index.php on line 45

 

Notice: Use of undefined constant vastaus1 - assumed 'vastaus1' in /var/www/virtual/uusilegenda.net/htdocs/vieraskirja/index.php on line 56 Notice: Use of undefined constant vastaus2 - assumed 'vastaus2' in /var/www/virtual/uusilegenda.net/htdocs/vieraskirja/index.php on line 62

 

etc.

 

(otsikko = title, viesti = message, vastaus1 = reply1, vastaus2 = reply2. It's finnish.)

 

What should I do to fix this..?  :unsure:

Link to comment
https://forums.phpfreaks.com/topic/285542-broken-php-guestbook/
Share on other sites

If there aren't any other, larger, more important problems lurking then it's just a matter of putting quotes around array keys.

 

Turn this

$_POST[otsikko]
into this

$_POST["otsikko"] // or $_POST['otsikko']
The file and line numbers in the error messages will point you to where the problems are.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.