Tymochenko Posted January 21, 2014 Share Posted January 21, 2014 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..? Quote Link to comment Share on other sites More sharing options...
requinix Posted January 21, 2014 Share Posted January 21, 2014 (edited) 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 January 21, 2014 by requinix Quote Link to comment Share on other sites More sharing options...
Tymochenko Posted January 21, 2014 Author Share Posted January 21, 2014 Thank you so much Requinix. It helped for most parts, but there are still some weird things in Kirjaudu page: Notice: Undefined index: msg in /var/www/virtual/uusilegenda.net/htdocs/vieraskirja/kirjaudu.php on line 66 What should I do to those? Quote Link to comment Share on other sites More sharing options...
requinix Posted January 21, 2014 Share Posted January 21, 2014 Depends what the code is, but you're probably trying to use an index in $_GET or $_POST that hasn't been set and you probably should try to check that it's been set before using it. Quote Link to comment Share on other sites More sharing options...
Tymochenko Posted January 21, 2014 Author Share Posted January 21, 2014 (edited) 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 January 21, 2014 by Tymochenko Quote Link to comment Share on other sites More sharing options...
requinix Posted January 21, 2014 Share Posted January 21, 2014 Then what I said is true. And here's a link. I personally don't understand PHP coding at all...I'm "noob" who only uses xhtml and css hahah..Then might I suggest you try, I dunno, learning it? Quote Link to comment Share on other sites More sharing options...
Tymochenko Posted January 21, 2014 Author Share Posted January 21, 2014 I would, but I have no time to learn how to code with PHP. My schedule is booked full. But thanks for everything! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.