Jump to content


Photo

How Do I Reference An include Within An Include?


  • Please log in to reply
2 replies to this topic

#1 Dhira

Dhira
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 12 April 2006 - 10:55 AM

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

<?php include("<? include("/home/lifeins/public_html/root.php"); ?>/linktator/linktator.php>
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...")



#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 12 April 2006 - 11:10 AM

I dont think you can do an include within an include! Why are you doiung an include within an include for?

#3 Dhira

Dhira
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 12 April 2006 - 11:25 AM

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 trying 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.co...r/linktator.php)" ?>[/quote] however, since I already 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).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users