Jump to content

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. Edited by requinix

I personally don't understand PHP coding at all...I'm "noob" who only uses xhtml and css hahah..

 

On that line (66) there's:

if($_GET["msg"]=='error') { echo '<p><font color=red><b>TARKISTA SALASANA/TUNNUS!</b></font></p>'; } ?>
Edited by Tymochenko
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.