0

I'm not a professional, but just a user that a lot of years ago wrote some simple code. Last days I changed my PHP version to 5.6.40 (and next days to PHP 7.3.x), and my guestbook won't work Here is a little part of the code (I can't copy and paste, I don't know why...):

<a href="tuafirma.php?go=sign"><font color=red>clicca qui</font></a>
<?php
if($d)
{
if($password==$delete_pass && ereg("[0-9]+",$d))
{
        mysql_query("delete from guestbook where id='$d'");
    echo "<h3>Il commento e' stato cancellato</h3><p>";
}
else
{
    die("Inserisci la password<br> <form method=post action=$PHP_SELF?l=$l><input type=hidden name=d value=$d><input type=password name=password> <input type=submit value=delete></form>");
}
}

It worked until some days ago, now no!

Link: https://www.piccioli.com/genealogia/tuafirma.php

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
  • The solutions are in the duplicates. It's not only the mysql api that isn't support on PHP 7.3 but `ereg()`also. – Funk Forty Niner Feb 24 '20 at 15:01
  • You should also learn to use what is called a "prepared statement". You are open to an SQL injection that could lead to your site/database get compromised. – Funk Forty Niner Feb 24 '20 at 15:03
  • While updating to a recent version of PHP is a good thing to do, as not a professional developer, you probably shouldn't be the one to do it. – Patrick Q Feb 24 '20 at 15:04

0 Answers0