PC Nerd Posted June 29, 2008 Share Posted June 29, 2008 Hi, Code: <?php $OUTPUT = array(); $PAGE_LEVEL = 1; $_USER['doc_root'] = '../'; ob_start(); ### ### Main page output, start template buffering ### echo "Content part 1<br>"; echo "Content part 2<br>"; echo "Content part 2<br>"; $OUTOUT['CONTENT'] = ob_get_contents(); #$OUTPUT['CONTENT'] = "TESTING!!!"; #ob_get_flush(); ob_clean(); #ob_start(); require("../themes/template.php"); $OUTPUT['template'] = ob_get_contents(); ob_clean(); #ob_start(); require("../pre/crumbs.php"); $OUTPUT['CRUMBS'] = ob_get_contents(); ob_clean(); #echo $OUTPUT['template']."<br>"; #echo $OUTPUT['CRUMBS']."<br>"; $OUT = ""; #$OUT .= $OUTPUT['CRUMBS']; #$OUT .= "<br>".$OUTPUT['template']; $OUT .= "<br>".$OUTPUT['CONTENT']; /* #$OUT .= str_replace("[%CONTENT%]", $OUTPUT['CONTENT'], $OUTPUT['template']); #$OUT .= str_replace("[%CRUMBS%]", $OUTPUT['CRUMBS'], $OUTPUT['template']); */ echo $OUT; ?> $OUTPUT['CONTENT'] isnt set - and doesnt display. eventually( as you can see from the commented out areas), Ill bs using the include files to replace content in a templat.... hence $OUTPUT['template'] Am I using the wrong function, or is there somethign else ive missed? thanks Quote Link to comment Share on other sites More sharing options...
papaface Posted June 29, 2008 Share Posted June 29, 2008 ob_clean();[code] I don't think you're supposed to put that in until after [code]echo $OUT; But I may be wrong.[/code][/code] Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted June 29, 2008 Author Share Posted June 29, 2008 but if ive stored the output as a variable as i have done.. ( in the array)... it shouldnt really care whether its output to "echo" or otput to storage. * Ive tried a range of functions: ob_get_flush(); to get the contents, and that way i didnt have to clear the buffer and all sort of things. also - i tried commenting out all of the ob_clean();'s, and placed a single one after the echo $OUT; but it made no difference. Any other suggestions? Thanks Quote Link to comment Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 When you first assign something to $OUTPUT['CONTENT'] you've miss-spelt it. You have the following... $OUTOUT['CONTENT'] = ob_get_contents(); When it should be... $OUTPUT['CONTENT'] = ob_get_contents(); Also, just a thought, but upper case variables names look horrible. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted June 29, 2008 Author Share Posted June 29, 2008 ahhh - of course.. Thanks Quote Link to comment Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 No worries! If this is solved now please click the 'Topic Solved' link at the bottom left of the screen! Thanks Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted June 29, 2008 Author Share Posted June 29, 2008 yup - i usually do.. forgot this time ( been a whie since i was on here regularly) Thankyou! Quote Link to comment Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 No worries friend! Quote Link to comment 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.