Jump to content

Archived

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

Dhira

How Do I Reference An include Within An Include?

Recommended Posts

I'm getting an error when I reference a url within an include - probably because the url itself is an include.

[code]<?php include("<? include("/home/lifeins/public_html/root.php"); ?>/linktator/linktator.php>
[/code] where root.php is code for the server url string.

What is the proper code to reference this?

(The error is "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in...")

Share this post


Link to post
Share on other sites
I dont think you can do an include within an include! Why are you doiung an include within an include for?

Share this post


Link to post
Share on other sites
I'm doing an include within an include as a starting point. I know its wrong - after all it gives an error, I pasted it to show what I am[i] trying[/i] to do.

The reason is....the second include [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<? include("/home/lifeins/public_html/root.php"); ?>[/quote] is for code that shows the url of the site (http://www.domain.com). By itself it shows the url of the domain correctly because 'root.php' has the correct php string for the url.

Now, what I want to do is [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php include ("http://www.domain.com/linktator/linktator.php)" ?>[/quote] however, since I [b]already[/b] have code that automatically references the url (in root.php) I would like to somehow reference root.php which is located in the 'public_html' folder.

So what would be the correct way to reference the 'root.php' file without having to type in the actual url?

(The reason is because there are many domains I need to do this for).

Share this post


Link to post
Share on other sites

×

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.