Easy Contact Forms plugin does not work with PHP 5

2019-09-10 03:17发布

The WordPress plugin Easy Contact Forms doesn't with WordPress 3.9 and PHP 5.5.9

It doesn't show the form fields, nor you can edit, and it won't show the form in the website.

I notice because it gives me this error:

Ajax error. Status =error Internal Server Error

I look at the log files and see the error is in the file: easy-contact-forms/easy-contact-forms-database.php at line 152, due to the function mysql_real_escape_string

I tried to use another similar functions, but either doesn't work, or deletes data, or doesn't work for every query.

1条回答
SAY GOODBYE
2楼-- · 2019-09-10 03:29

After watching the file code, you can realize that this plugin is not perfectly made, it's inconsistent. It changes it's MySQL connection !

One quick fix to make it work, (I know this is not the best way):

in the wptn function add:

mysql_connect('localhost', 'user', 'password');

Like this:

function wptn($query) {

        global $wpdb;

        mysql_connect('localhost', 'myuser', 'mypassword');
        $query = str_replace("#wp__", $wpdb->prefix, $query);
        return $query;

    }
查看更多
登录 后发表回答