mattal999 Posted April 23, 2009 Share Posted April 23, 2009 Try taking off the: $_SERVER['DOCUMENT_ROOT'] . so it looks like: include_once('../fab/includes/template.php'); Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817490 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 Try taking off the: $_SERVER['DOCUMENT_ROOT'] . so it looks like: include_once('../fab/includes/template.php'); Yeah, sorry I didn't know you still had the DOCUMENT_ROOT in there still. Do what matt suggested, it should work. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817492 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 ok so I did that and now get this.. Warning: main(../fab/header.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 7 Warning: main() [function.include]: Failed opening '../fab/header.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 7 Warning: main(../fab/main_menu.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 8 Warning: main() [function.include]: Failed opening '../fab/main_menu.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 8 Parse error: syntax error, unexpected '>' in /home/content/s/c/t/sctfaery/html/fab/includes/footer.php on line 4 HUH???? I am about ready to give up..I bet you guys are WAY PAST THAT!!! Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817500 Share on other sites More sharing options...
mattal999 Posted April 23, 2009 Share Posted April 23, 2009 Well, we have one success on the bottom of the page: the footer.php page got included. Your footer page also contains coding errors, but you're other pages are not including. Did you change them to ../fab/includes/*.php? Oh, and by the way, my name aint Matt EDIT: Change the includes path's from '/fab/includes/*.php' to 'includes/*.php' Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817507 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 ok YES i did change them to ../fab/includes/*.php? as per your suggestion.. and the footer got included? how come I can't see it? so I am totally retarded.. and old.. maybe this is all beyond me.. I hate to quit.. anything, but Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817512 Share on other sites More sharing options...
mattal999 Posted April 23, 2009 Share Posted April 23, 2009 Here is some code. Make a new page, paste it in and run it. <?php include("includes/header.php"); include("includes/main_menu.php"); include("includes/footer.php"); include("includes/template.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817514 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 ok.. so here is the header.php file <?php $header .= $page_title; $header .= "<img src="/images/fab/mini_logor.gif" alt=" Feeling Absolutely Fabulous Logo" />"; ?> --- and here is what i get now.. Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/s/c/t/sctfaery/html/fab/includes/header.php on line 3 Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817525 Share on other sites More sharing options...
mattal999 Posted April 23, 2009 Share Posted April 23, 2009 You are closing the string with the quotes contained in the HTML. Here is how it should be: <?php $header .= $page_title; $header .= "<img src=\"/images/fab/mini_logor.gif\" alt=\" Feeling Absolutely Fabulous Logo\" />"; echo $header; ?> Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817528 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 ok..better..so look at this http://feelingabsolutelyfabulous.com/matt.php ok so I messed around a bit more.. can I ask one last q? if I want to use that (fixed properly) as a template and want to create the content for the main area.. what is the php statement? to get the files into it? I hope I worded that right and you freakin' ROCK!! Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817536 Share on other sites More sharing options...
mattal999 Posted April 23, 2009 Share Posted April 23, 2009 template.php: <?php include("includes/header.php"); include("includes/main_menu.php"); echo $content; include("includes/footer.php"); include("includes/template.php"); ?> index.php: <?php $content = "Your content"; include("includes/template.php"); ?> Try that. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817540 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 thanks so much.. so you know I'm not using a database and wanted to have the content files? I don't know where.. can I save them as _filename_bdy.php or should it be html or how does it know to change the content.. I sound like a dunce.. I did make a set of files for another site using all includes without the template file and then had to make a filename.php and a filenamebody.html to be included.. I am so thankful for all your help... Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817559 Share on other sites More sharing options...
tang Posted April 23, 2009 Share Posted April 23, 2009 template.php: <?php include("includes/header.php"); include("includes/main_menu.php"); echo $content; include("includes/footer.php"); include("includes/template.php"); ?> I think you just divided by zero ;-) Should be: <?php include("includes/header.php"); include("includes/main_menu.php"); echo $content; include("includes/footer.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817564 Share on other sites More sharing options...
mattal999 Posted April 23, 2009 Share Posted April 23, 2009 template.php: <?php include("includes/header.php"); include("includes/main_menu.php"); echo $content; include("includes/footer.php"); include("includes/template.php"); ?> I think you just divided by zero ;-) Should be: <?php include("includes/header.php"); include("includes/main_menu.php"); echo $content; include("includes/footer.php"); ?> It seems I may have just created a black hole... Thanks for pointing that out! Would have wrecked the whole page. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817617 Share on other sites More sharing options...
mattal999 Posted April 23, 2009 Share Posted April 23, 2009 If I have your question correct, then this should work: template.php: <?php include("includes/header.php"); include("includes/main_menu.php"); echo $content; include("includes/footer.php"); ?> index.php: <?php $action = $_GET['action']; if($action == "home") { // Check for the page (in this case, page=home) $content = file_get_contents("pages/home.php"); // Include the page in the directory 'pages/' } else { $content = file_get_contents("pages/home.php"); } include("includes/template.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817630 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 very last q I PROMISE!! and by the way you are a PHP GOD!!! which of those pages gets all the metatags, and css style sheet include link, I directed the page to get content1 info and voila!! check it out: http://feelingabsolutelyfabulous.com/index.php I have to add the rest of my design but you have aided me greatly! I really thank you for all your time and patience.. you must be a great guy!! Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817653 Share on other sites More sharing options...
redarrow Posted April 23, 2009 Share Posted April 23, 2009 have a look at your css, and your find this is what you want, on the first page. <link href="scripts/faf2.css" rel="stylesheet" type="text/css" /> sorry what are you asking , just rename the home.php to index,php your done arnt you? what have you done are you using mod_rewrite there? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817661 Share on other sites More sharing options...
redarrow Posted April 23, 2009 Share Posted April 23, 2009 There no reason for the first page, as you got all the other pages correct. Use a switch, and default the home.html as default. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817685 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 There no reason for the first page, as you got all the other pages correct. Actually I don't want to use the old site.. that is one I created in 2007.. have moved on since then which is why I am using php or should I say trying to Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817688 Share on other sites More sharing options...
redarrow Posted April 23, 2009 Share Posted April 23, 2009 what are you doing you got .php and .html what going on lol. if your using php, should be .php ,unless added as html seen as a php pagem, in the php.ini? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817693 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 what are you doing you got .php and .html what going on lol. if your using php, should be .php ,unless added as html seen as a php pagem, in the php.ini? redarrow please don't jump into the middle of a thread when you obviously haven't read the previous posts, you're just confusing everyone. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817697 Share on other sites More sharing options...
mattal999 Posted April 23, 2009 Share Posted April 23, 2009 I dont quite understand your question at the moment. I think that you are asking which page includes the stylesheet, which I think is: main_menu.php. If this is wrong, then try rephrase your question Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817708 Share on other sites More sharing options...
redarrow Posted April 23, 2009 Share Posted April 23, 2009 Maq i got a privet post, from the user so i do understand mate? lets all get this write, you got a web site, and you wanted to add php, so now your using php $_GET[], on the first page to get the html pages, am i correct. if i am correct, then you need to rename all the html pages to .php pages. your index.html should be index.php. because your going to do that, then re name all the included pages with the correct . ext .php make sure that the first page is index.php if you just rename all the .html to .php and change the links to .php it will all work no other code needed. php can use html as a .php ext name. you can break in and out of php and html any time you want. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-817711 Share on other sites More sharing options...
themuffin Posted April 24, 2009 Author Share Posted April 24, 2009 Thanks all.. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/page/2/#findComment-818072 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.