ziola1039 Posted August 9, 2007 Share Posted August 9, 2007 I am trying to pass the url of a page actually on to the page and I was using this: <?php echo print $PATH_INFO = str_replace("/", "-", $_SERVER['REQUEST_URI']);?> but I want to include this on an include file - so lets say that that code is on a page here: "/includes/page1.php" and then on page2.php I have this: <?php include('/page1.php'); ?> what happens is the URL on my page is written on the page as like "-page1.php" but what I want is it to say "-page2.php" anyone know how to do this? Quote Link to comment https://forums.phpfreaks.com/topic/64135-putting-url-to-site-on-my-page/ Share on other sites More sharing options...
Fadion Posted August 10, 2007 Share Posted August 10, 2007 Actually u have that code in page1.php and that page is being included in page2.php, right? I tried it myself just to be sure and it is echoing -page2.php and thats normal. Page1 is being included and that code is being parsed as code of page2, so it will return the url of page2. Quote Link to comment https://forums.phpfreaks.com/topic/64135-putting-url-to-site-on-my-page/#findComment-319882 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.