Welcome to WebmasterWorld Guest from 54.145.13.215

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

How to execute en external php file but not using INCLUDE

     
4:01 pm on Jul 24, 2008 (gmt 0)

New User

5+ Year Member

joined:Mar 28, 2007
posts: 8
votes: 0


Hi All,

I want to know how to execute a php file from another file.

I just don't want to use INCLUDE('file.php') function because i'll have problems with paths.

So, I just want to RUN it not CALL it or include it.

Example

index.php:

<?php
EXECUTE 'www.mysite.com/file.php';

my cotent...

?>

Thanks in advance.

3:37 pm on July 26, 2008 (gmt 0)

Moderator This Forum from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
posts:7557
votes: 3


I think you should work on making your paths issue work correctly. For example use full paths as a variable.

$path="/me/user/site/public_html";

include "$path/file.php";

Use a full location that way it will be correct no matther where within the "pyramid" your page is located.

Hope this helps.

Mack.