anonīms Posted March 13, 2010 Report Share Posted March 13, 2010 http://paste.php.lv/0c9b9f09b6dd7226562767011bc42946?lang=php Nepiesienieties pareizrakstībai ^^ Tātad kā man dabūt to $Content = include $page, lai $pages saturs tiktu arī uzskatīts kā $Content? Pašlaik ir tā, ka lapa tiek inklūdota un parādas pirms visiem html atbributiem nevis iekšs <body> yo!<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>title haha!</title> </head> <body> 1 </body> </html> Quote Link to comment Share on other sites More sharing options...
bubu Posted March 13, 2010 Report Share Posted March 13, 2010 Aizstāj tās $page saturu ar funkciju: function get_page_content() { return "My page content"; } Un tad savā failā raksti (neaizmirsi pārbaudīt uz GET parametru validāti, citādi "uzhakos" ka nemetās): include($page); $content = get_page_content(); Quote Link to comment Share on other sites More sharing options...
anonīms Posted March 13, 2010 Author Report Share Posted March 13, 2010 grrr :D Es tā centos, lai nevajadzētu to fju izmantot, jo pašlaik to daru, un riebjas, ka ir dati, kurus iekšs funkcijas vnk neatpazīst un nepieciešams definēt pa jaunu. Teiksim index failā ir $bubu = 'jajajjaja!'; bet iekšs function page() { echo $bubu; // neko neizvadīs, jo atkal visu vajag definēt pa jaunu. } Varbūt ar to var cīnīties citā veidā? Quote Link to comment Share on other sites More sharing options...
waplet Posted March 13, 2010 Report Share Posted March 13, 2010 iekš funkcijas ieliec global $bubu; Quote Link to comment Share on other sites More sharing options...
anonīms Posted March 13, 2010 Author Report Share Posted March 13, 2010 yo! thx waplet, tik, kur tu biji agrāk... :D Quote Link to comment Share on other sites More sharing options...
waplet Posted March 13, 2010 Report Share Posted March 13, 2010 man šī paša problēma bija :D 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.