From: Reini U. <ru...@x-...> - 2005-06-13 17:58:41
|
Paul Mennega sagte: > 2005/6/12, Reini Urban <ru...@x-...>: >> Paul Mennega schrieb: >> > Sorry, one follow up question... >> > >> > When I try to include a file that has a number of pre-defined >> > functions in it, (I am including thei file at the top of html.tmpl, = I >> > get a bunch of errors when this file is called from other elements I >> > am including in body.tmpl, etc. >> > >> > /include/common.php (In template 'body') (In template 'html'):438: >> > Notice[8]: Undefined index: MemberName >> >> Index of what? > > Exactly... All I am doing is referencing a cookie in my .php file > that I included into the body.tmpl. $_COOKIE("MemberName"); you mean $_COOKIE["MemberName"] > The above is the error that I get. > >> >> > MemberName is actually a cookie, used in a query on line 428 as >> > $_COOKIE['MemberName']. >> >> $_COOKIE is only defined for php > 4.3 >> $HTTP_COOKIE_VARS is only defined globally, not locally. >> Inside functions you have to global $HTTP_COOKIE_VARS or use $_COOKIE. >> > > I am using $_COOKIE. These functions I am including work like a charm > everywhere else on my site, but when included into the body.tmpl, I > get all kinds of these 'Unknown Index' error messages. > >> > Any ideas what I have done wrong, or are user-defined functions not >> > executed properly from phpwiki templates? > > I appreciate your help. I spent 15 hours this weekend pulling my hair > out trying to get this to work, with no luck. All I want to do is > modify body.tmpl so that I can include my common website header (logo, > etc.) One of the things that this included file does is displays one > set of content if the user is logged in, another if not. That is what > I store in the cookies, but this is simply not handling it... so > should I change all $_COOKIE references to a globalled > $HTTP_COOKIE_VARS? Or is there a way to modify the way the wiki > parses the templates to allow me to use $_COOKIE? > > Sorry for the questions, I have looked everywhere and can't find > ANYTHING about this issue, but it must have come up before... You just experience basic php problems. phpwiki does not interfere with that. Look at your /include/common.php and guard the $_COOKIE['MemberName'] reference with if (isset($_COOKIE['MemberName'])) blabla... otherwise you'll get these warnings, aeh notice. |