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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.