phpmysqlweb-scrapingjoomlafile-get-contents

Did PHP file_get_contents just erase my database?


Yesterday, i was searching for techniques to push and pull information into an app that I'm playing with. In my research, I happened to come across the following PHP script:

    <?php 
    $url = 'http://www.example.com'; 
    $output = file_get_contents($url); 
    echo $output; 
    ?>

I tried it out on with a Joomla website that I'd put together a while ago. Was pretty cool. It pulled all of the information and displayed it on the new url. Groovy. I closed the url and removed this php file from the site.

Now...DRAMAS!! Today, I visited the url of my Joomla page today to edit a few minor content items I'd noticed, and...

Database Error: Unable to connect to the Database: Could not connect to database

I've logged into the control panel and tried to look into the database through phpMyAdmin through the control panel...but its coming up blank! I mean, nothing. And the databases are showing 0Mb.

I checked the FTP login and all files and folders seem to be in place as per usual.

Does anyone know what has happened?


Solution

  • file_get_contents should have the same effect on your database as visiting the page with your browser. None that is.