Jump to content

How Do I Reference An include Within An Include?


Dhira

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...")

Link to comment
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).
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.