ghosh Posted August 20, 2007 Share Posted August 20, 2007 Hello, we use this when we are here of a site ... "www.x.com/home" and we want to include a file which is here "hello/hello_world/home/hello.php" <?php include ("hello/hello_world/home/hello.php"); ?> but when we are here of a site "hello/hello_world/home/hello.php" how do we include this "www.x.com/home" this way? <?php include ("http://www.x.com/home/index.php"); ?> I am novice so be kind with me! Thanks Ghosh Quote Link to comment https://forums.phpfreaks.com/topic/65754-solved-include-syntax/ Share on other sites More sharing options...
MadTechie Posted August 20, 2007 Share Posted August 20, 2007 for <?php include ("http://www.x.com/home/index.php"); ?> to work, your need allow remote include to be turned on in the php.ini allow_url_include On this directive did not exist until php 5.2.1 1) you cannot use it with versions prior to 5.2.1 2) You’ll need to add it to your php.ini, as you probably won’t find it in there already 3) allow_url_fopen has to be enabled 4) This has to be in the php.ini server-side, and not the .htaccess Quote Link to comment https://forums.phpfreaks.com/topic/65754-solved-include-syntax/#findComment-328475 Share on other sites More sharing options...
hostfreak Posted August 20, 2007 Share Posted August 20, 2007 Are these the same sites? If so, ../../home/index.php should work. Quote Link to comment https://forums.phpfreaks.com/topic/65754-solved-include-syntax/#findComment-328479 Share on other sites More sharing options...
ghosh Posted August 20, 2007 Author Share Posted August 20, 2007 Actually the problem that I am facing is of this kind.. i have a form at this location: www.x.com/home/health/health.php now I want the form to send me information at www.x.com/scripts/visitors/comments/connect.php How do I use the include syntax in "www.x.com/home/health/health.php"? some thing like this one <?php include("../../connect.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/65754-solved-include-syntax/#findComment-328484 Share on other sites More sharing options...
MadTechie Posted August 20, 2007 Share Posted August 20, 2007 so www.x.com/home/health/ ../ (back one) www.x.com/home/ ../ (back one) www.x.com/ then forward scripts/visitors/comments/connect.php <?php include("../../scripts/visitors/comments/connect.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/65754-solved-include-syntax/#findComment-328497 Share on other sites More sharing options...
ghosh Posted August 20, 2007 Author Share Posted August 20, 2007 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/65754-solved-include-syntax/#findComment-328555 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.