GameYin Posted October 30, 2008 Share Posted October 30, 2008 Hah damn been a long time since I've been here.. I have this page http://www.devwebsites.com/sitedevs/ I get an error when trying to do this include "default.php?pageTitle=Home"; default.php includes the dtd, all the same crap that begins every page. I want a custom <title> though for each page and that is where pageTitle comes in. If I went to index.php where I have include "default.php?pageTitle=Home";, the <title> will read: SiteDevs * Home. Get it? Anyway it's giving me an error on include "default.php?pageTitle=Home"; My default.php works just fine because if I go there and manually do it it shows fine. Quote Link to comment https://forums.phpfreaks.com/topic/130665-solved-includes-question/ Share on other sites More sharing options...
revraz Posted October 30, 2008 Share Posted October 30, 2008 And the error is....? Quote Link to comment https://forums.phpfreaks.com/topic/130665-solved-includes-question/#findComment-678034 Share on other sites More sharing options...
teng84 Posted October 30, 2008 Share Posted October 30, 2008 "default.php?pageTitle=Home"; wheres this file located is this the same dir with index? Quote Link to comment https://forums.phpfreaks.com/topic/130665-solved-includes-question/#findComment-678038 Share on other sites More sharing options...
bobbinsbro Posted October 30, 2008 Share Posted October 30, 2008 here's my theroy: this will not work, as include opens a file from the drive, and doesn't send a url request to a webserver. as a result, putting $_GET variables after the filename will mess you up... the include in your script is looking for a file in the current folder thats actually called "default.php?pageTitle=Home" and not "default.php" and then passing it pageTitle=Home. Quote Link to comment https://forums.phpfreaks.com/topic/130665-solved-includes-question/#findComment-678046 Share on other sites More sharing options...
teng84 Posted October 30, 2008 Share Posted October 30, 2008 here's my theroy: this will not work, as include opens a file from the drive, and doesn't send a url request to a webserver. as a result, putting $_GET variables after the filename will mess you up... the include in your script is looking for a file in the current folder thats actually called "default.php?pageTitle=Home" and not "default.php" and then passing it pageTitle=Home. my bad didn't see that part Quote Link to comment https://forums.phpfreaks.com/topic/130665-solved-includes-question/#findComment-678047 Share on other sites More sharing options...
GameYin Posted October 30, 2008 Author Share Posted October 30, 2008 Holy crap a lot of replies... I figured out it was going for the literal string. I ended up doing something like this. default.php part <title>SiteDevs • <? echo $pageTitle; ?></title> index.php part $pageTitle="Home"; include 'default.php'; Quote Link to comment https://forums.phpfreaks.com/topic/130665-solved-includes-question/#findComment-678054 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.