[pmwiki-users] Data storage project

Kathryn Andersen kat_lists at katspace.homelinux.org
Mon Jul 31 21:30:09 CDT 2006


On Mon, Jul 31, 2006 at 11:43:34AM -0400, The Editor wrote:
> # Function called by directive to retrieve form data
> function ReadData($l) {
>  global $WorkDir;
>  $datapage = substr($l, 1);
>  clearstatcache();
>  if ($dr = fopen("$WorkDir/$datapage", "rb")){
>        $pc = fread($dr, filesize("$WorkDir/$datapage"));
>    fclose($dr);
>        $dc = explode("(:comment data:) %0a%0a", $pc);
>        $db = explode(" %0a%0a", $dc[1]);
>        foreach ($db as $df) {
>                $dv = explode ("=", $df);
>                $f = "\${$dv[0]}";  //also "$$dv[0]" seems to work
>                $v = $dv[1];
>                $FmtPV['$f'] = $v;  //problem seems to be here
> 		return "$f + $v + $FmtPV[$f] + $FmtPV[$profile]";  // used for debudding
>                }
>        return;
>  }
>  return "data not found";
> }

Er, shouldn't you have 
        global $WorkDir, $FmtPV;
 
Otherwise you'll be just changing a local version of $FmtPV and not
affecting the real one.

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe




More information about the pmwiki-users mailing list