Hi
i have a base file and another file is included in it. that included file has another include file.
second include file has some database connections. but i am not able to call functions in the second include from my base file.
when i try to pring $_SERVER['PHP_SELF'] from my first include file it prints the base file name. but when i tried it from the second include it prints its own path.
but this setup is working fine on linux machines.
corrently iam working on windows xp,iis, php 4.4 and mysql 4.1.9.
please help.
thanks.
php include file problem
Moderator: General Moderators
feyd | Please use
userheader.htm ---- file content
pageconfig.php ---- file content
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
my_home.php -----base file contentCode: Select all
<?php
include _ROOT_PATH_."myxt_includes/userheader.htm";
?>Code: Select all
<?
include_once ( _ROOT_INCLUDE_PATH_."myxt_includes/pageconfig.php");
echo eregi_replace(".php$","",$_SERVER['PHP_SELF']); //---here it prints path to my_home.php
?>pageconfig.php ---- file content
Code: Select all
<?
echo eregi_replace(".php$","",$_SERVER['PHP_SELF']); //---here it prints path to pageconfig.php
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]define ('_ROOT_INCLUDE_PATH_','http://localhost/xtimeaus/'); //this is the wesite root path
and
define ('_ROOT_PATH_', strrev(strstr(strrev($_SERVER['SCRIPT_FILENAME']),DIRECTORY_SEPARATOR)).'../'); //this is defined in every base files.
ie, mycxc_home.php here.
and
define ('_ROOT_PATH_', strrev(strstr(strrev($_SERVER['SCRIPT_FILENAME']),DIRECTORY_SEPARATOR)).'../'); //this is defined in every base files.
ie, mycxc_home.php here.