Jump to content

Likely simple include question (godaddy)


Mikangakang

Recommended Posts

To preface this; I have very little php and website experience, so please bear with me.

What I'm trying to do is a (hopefully) simple php_include for the header, menu, and footer of my portfolio website. I'm using GoDaddy, which google has now told me does PHP in a really strange fashion.

 

EDIT: Okay, I fixed one problem, and since nobody has replied, I'm just going to edit this one topic.

 

The code I have is this:

<?php include ("http://mikholmes.com/phpinclude/topchunk.php"); ?>


Site Content

<?php include ("http://mikholmes.com/phpinclude/bottomchunk.php"); ?>

 

The errors I get are this:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/content/m/i/k/mikholmes/html/testphp.php on line 1

Warning: include(http://mikholmes.com/phpinclude/topchunk.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/content/m/i/k/mikholmes/html/testphp.php on line 1

Warning: include() [function.include]: Failed opening 'http://mikholmes.com/phpinclude/topchunk.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/m/i/k/mikholmes/html/testphp.php on line 1
Site Content
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/content/m/i/k/mikholmes/html/testphp.php on line 6

Warning: include(http://mikholmes.com/phpinclude/bottomchunk.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/content/m/i/k/mikholmes/html/testphp.php on line 6

Warning: include() [function.include]: Failed opening 'http://mikholmes.com/phpinclude/bottomchunk.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/m/i/k/mikholmes/html/testphp.php on line 6

 

Now, it no doubt has something to do with that pesky "url file access is disabled." How can I directly access my /phpinclude/ folder with pages in other folders?

Link to comment
Share on other sites

try using just the file location without trying to use the whole url:

 

I considered trying this, but due to assignment requirements (this is for a class assignment btw), I need to have different pages in different folders. So if I have

/mik/etc1/whatever.php

/mik/etc2/whatever2.php

how can I make both include

/mik/phpinclude/whatever

without specifying the URL?

 

HOWEVER, I did some googling, and added

<?php set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] ); ?>

to the top of my php pages, and I think it works. I've yet to try it out fully in multiple pages, but from this forum's experience and opinion, is this a good idea?

Link to comment
Share on other sites

well this should work just as well i think, as long as they are located in the same html_public folder just specify the folder path from there:

 

<?php

include 'mic/ect/whatever.php';

?>
<?php

include 'mic/ect2/whatever2.php';

?>

 

either that or i dont understand the question

Link to comment
Share on other sites

Other way around. I want to keep my topchunk.php and bottomchunk.php in the html_public/phpincludes/ folder, while having a bunch of pages in other folders.

So if "html_public/games/pages/etcetera/index.html" includes "phpincludes/topchunk.php", won't it say "Can't find /games/pages/etcetera/phpincludes/topchunk.php"?

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.