Jump to content

[SOLVED] fread


unidox

Recommended Posts

I have this script:

 

$url = "http://www.site.com/license.php?key=" . SITE_LIC . "&ref=" . $_SERVER["SERVER_NAME"] . "";
$lic = @fopen($url, "r+");
$lic = @fread($lic, 8192);

if ($lic == "0") {
header("Location: http://www.site.com/index.php?p=lic_invalid&site=" . $_SERVER["SERVER_NAME"] . "");
exit();
}

fclose($lic);

 

If I type the url in my address bar, it outputs 1 as desired. But when I try to echo $lic, nothing even outputs. Whats wrong?

Link to comment
https://forums.phpfreaks.com/topic/107387-solved-fread/
Share on other sites

I found one when working with gd image functions a while back. I can't remember the exact details, but it returned an error when nothing was found, instead of a -1 or something that I could have used. In that one situation it was preferable to use the '@' symbol, but I have never found any other situations.

Link to comment
https://forums.phpfreaks.com/topic/107387-solved-fread/#findComment-550607
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.