Jump to content

[SOLVED] include syntax


ghosh

Recommended Posts

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! ;D

 

Thanks

Ghosh

Link to comment
https://forums.phpfreaks.com/topic/65754-solved-include-syntax/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/65754-solved-include-syntax/#findComment-328475
Share on other sites

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");
?>

Link to comment
https://forums.phpfreaks.com/topic/65754-solved-include-syntax/#findComment-328484
Share on other sites

Archived

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

×
×
  • 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.