I have no idea if this is possible...
I have this
<?php include ('header.php') ?>'
And this
<?php
// Valid constant names
define("URL", "http://localhost/");
define("IMAGE", "http://localhost/images");
?> '
How can I echo the constant in the include code?
This is what I tried but it didn't work.
<?php include (echo URL header.php) ?>'
Is this possible? I want the include to be an exact file name without having to type in http://localhost everytime.







teammatt3 posted this at 23:51 — 4th November 2005.
He has: 1,907 posts
Joined: Sep 2003
Geez, I'm retarded. You have to connect to the include file where the constant is before you can USE the constant.
Nevermind, I figured out a different solution.
My Site | Regular Expression Tester
kazimmerman posted this at 23:57 — 4th November 2005.
He has: 582 posts
Joined: Jul 2005
If you could, please post your solution so anyone who may have the same problem in the future will see this post.
-Kurtis
~View (and vote for) my art at BrickFish!
teammatt3 posted this at 23:59 — 4th November 2005.
He has: 1,907 posts
Joined: Sep 2003
Well, I am just gonna do it the hard way. Just type out http://localhost for all the links.
Busy posted this at 08:41 — 5th November 2005.
He has: 6,157 posts
Joined: May 2001
As you are including the file, do what ever needs to be done in it (including echo), so the include is the result as well.
Depending what your intentions are you should also look at require and/or include/require_once
<?bhb if(broken){ echo("It wasn't me
"); } ?>
Learn HTML the ez way - EzHTML.net
Some people are like slinkies, they dont really serve any purpose but they still bring a smile to your face when you push them down the stairs ...
cpellizzi posted this at 05:11 — 9th November 2005.
He has: 57 posts
Joined: Apr 2005
It is simple.
Can't you just do
<?phpinclude(URL.'header.php');
?>
That should work