ztealmax Posted December 31, 2006 Share Posted December 31, 2006 Hi im really hitting my head in the wall, can't figure out how to define things like:$thingy inside my first file called read.php and inside that file i call for theme.phpand inside theme.php i want to be able to use the defined $thingy i defined in read.phpHow would i do something like that? Link to comment https://forums.phpfreaks.com/topic/32356-i-want-thingy-to-be-accecible-inside-my-themfile/ Share on other sites More sharing options...
fert Posted December 31, 2006 Share Posted December 31, 2006 read.php[code]$thingy="foo";require("theme.php");func();[/code]theme.php[code]function func{ global $thingy; echo $thingy;}[/code] Link to comment https://forums.phpfreaks.com/topic/32356-i-want-thingy-to-be-accecible-inside-my-themfile/#findComment-150255 Share on other sites More sharing options...
ztealmax Posted December 31, 2006 Author Share Posted December 31, 2006 the screen just go totaly blank when i try that! Link to comment https://forums.phpfreaks.com/topic/32356-i-want-thingy-to-be-accecible-inside-my-themfile/#findComment-150271 Share on other sites More sharing options...
fert Posted December 31, 2006 Share Posted December 31, 2006 ooops,[code]function func(){ global $thingy; echo $thingy;}[/code] Link to comment https://forums.phpfreaks.com/topic/32356-i-want-thingy-to-be-accecible-inside-my-themfile/#findComment-150272 Share on other sites More sharing options...
ztealmax Posted December 31, 2006 Author Share Posted December 31, 2006 hehe thanx ;) Link to comment https://forums.phpfreaks.com/topic/32356-i-want-thingy-to-be-accecible-inside-my-themfile/#findComment-150273 Share on other sites More sharing options...
ztealmax Posted December 31, 2006 Author Share Posted December 31, 2006 i dont seem to be able to <? echo $something ?> after i have put in this[b]news.php[/b](Partial code)[code]<?$caption="gurka";require("$themes/$themedata/theme.php");caption();?><? echo $news ?>[/code]the $news thats inside theme.php im trying to echo out is:[b]theme.php[/b][code]<?PHPfunction caption(){ global $caption; echo $caption;}$news .="<table style='width:100%; background-color:#FFFFFF' cellspacing='3' class='topborder'><tr><td class='caption' style='white-space:nowrap'>".$caption."</td><td class='content'>".$content."</td><</tr></table></div>";?>[/code]what am i doing wrong at this point? Link to comment https://forums.phpfreaks.com/topic/32356-i-want-thingy-to-be-accecible-inside-my-themfile/#findComment-150275 Share on other sites More sharing options...
ztealmax Posted December 31, 2006 Author Share Posted December 31, 2006 No idea ? ::) Link to comment https://forums.phpfreaks.com/topic/32356-i-want-thingy-to-be-accecible-inside-my-themfile/#findComment-150299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.