Jump to content

disabled fopen:n


brendanb

Recommended Posts

hi there

 

i had a website built for me a while ago and all has been good apart from my host has now disabled fopen... whatever that is.... so whats happened is that my website seems to have lost the path to my template.

 

my host has said i need to find a replacement to the following line which is in a file called global.php:

-----------------------------------------------------------

$file="common/matter.php";

$handle=fopen($file,"rb");

-----------------------------------------------------------

 

Does anyone have any ideas on what i am to do?

 

the below is what is in my pages that i am guessing set the base url and call the template?

 

include("global.php");

$base="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

$base=substr($base,0,(strrpos($base,"/")+1));

$base=$base."common/";

$base="<base href=\"$base\">";

 

many thanks

brendan

Link to comment
https://forums.phpfreaks.com/topic/268460-disabled-fopenn/
Share on other sites

The $base variable has nothing to do with the PHP code. All it does is to set the <base href=""> tag for the browser to read.

 

As for your issue, you'll want to look at either file_get_contents () or file (). Depending upon how you want to use the contents of the file.

Though, if that file contains PHP code then you're doing it wrong, and should be using require_once () or include () instead.

 

PS: Please use the


tags around your code, as it helps make both your post and your code a lot easier to read.

Link to comment
https://forums.phpfreaks.com/topic/268460-disabled-fopenn/#findComment-1378547
Share on other sites

thanks for the reply.

 

i kniow nothing of php etc so i dont understand what u are meaning but i will search for what you have mentioned and see what i can find

 

so i guess the line i need to replace is $handle=fopen($file,"rb");  with either file_get_contents () or file () ??

 

thanks

 

Link to comment
https://forums.phpfreaks.com/topic/268460-disabled-fopenn/#findComment-1378549
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.