Easy Contact Forms plugin does not work with PHP 5.5.9

ぃ、小莉子 提交于 2019-12-11 22:43:54

问题


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:


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;

    }


来源:https://stackoverflow.com/questions/25648361/easy-contact-forms-plugin-does-not-work-with-php-5-5-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!