drokkon Posted May 11, 2007 Share Posted May 11, 2007 I'd like to use a variable to construct the URL called by an include. Is this possible? Assuming it works something like the "echo" command: include("includes/products/".$nickname."html"); Is that possible? I know, I need to go read a book. :/ Thanks! Teddy Link to comment https://forums.phpfreaks.com/topic/50940-a-variable-in-an-include-url/ Share on other sites More sharing options...
StormTheGates Posted May 11, 2007 Share Posted May 11, 2007 Yes that is possible. Just make sure the file exists. You need a . before html though Link to comment https://forums.phpfreaks.com/topic/50940-a-variable-in-an-include-url/#findComment-250567 Share on other sites More sharing options...
taith Posted May 11, 2007 Share Posted May 11, 2007 yup... works fine :-) i personally wouldnt suggest a book for tiny things like these... just go try em... see if they work... Link to comment https://forums.phpfreaks.com/topic/50940-a-variable-in-an-include-url/#findComment-250568 Share on other sites More sharing options...
drokkon Posted May 11, 2007 Author Share Posted May 11, 2007 1) You guys are quick!!! 2) Sorry, you're right - just try 'em out before I post little things here. It worked right away (after I added the period). T Link to comment https://forums.phpfreaks.com/topic/50940-a-variable-in-an-include-url/#findComment-250601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.