Jump to content

Warning: file_get_contents() [function.file-get-contents]

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Bioshox

Bioshox

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
Warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in /home/a9415680/public_html/submitaction.php on line 34

I get this error on one of my websites, basicaly, it's suppose to say you didn't enter the captcha correctly and display the form again in order to fill it in, although I get this error, it was working previously but now it's just not! Here is the related code:

<?php
function getTitle($link){
    $str = file_get_contents($link) or die ("Error");
    if(strlen($str)>0){
        preg_match("/\<title\>(.*)\<\/title\>/",$str,$title);
        return $title[1];
    }
}

  require_once('core/recaptchalib.php');
  $privatekey = "---------------------------------------";
  $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);



#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
Do you know how to read the error?

Quote

Warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in /home/a9415680/public_html/submitaction.php on line 34

It is providing the function, file_get_contents, along with a link to its usage. It then gives the error that has occurred in the specific file and line.

Try to determine why the string passed to the function was empty, or blank.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users