Re: [phplib] templates and menus - HELP!! From: Eric Naujock (naujocke <email protected>)
Date: 03/28/01

In your function you use the echo command. This causes the text to go directly to the output device. In this case the web browser. To fix this have your function use sprintf stataments to generate the output as a string Then feed the return the string from your function.

Then when you parse the template you will find that the items appear where you want them.

Hope that helps.

>>> "paula" <paula <email protected>> - 3/27/01 5:20 PM >>>
ok, this is driving me crazy, so any idea is welcome:

I'm using PHPLIB templates. There are multiple tables nested, inside one cell (<td></td>) there should be a drop down menu, each option is an array element. I've made a simple function to create drop down menus:

function MenuMaker($form_name,$select_name,$act,$my_arr) {

  echo "\n";
  echo '<form name="'.$form_name.'" method="post" action="'.$act.'">'."\n";
  echo '<select name='.$select_name.'>'."\n";
  while (list($key,$value)=each($my_arr)) {
    echo '<option value='.ereg_replace(" ","_",$value).'>'.$value.'</option>'."\n";
  }
  echo '</select>'."\n";
  echo '<input type="button" value="GO" style="BACKGROUND: #6699FF; FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; FONT-WEIGHT: bold; padding:1; border:thin solid black; width=30">'."\n";
  echo '</form>'."\n";

}

inside this cell I put: <td>{division_list}</td>

Then, on my script I use $division_list => (MenuMaker("division","division_list","scr.php",$my_arr))

I also tried defining a variable: $division_list = (MenuMaker("division","division_list","scr.php",$my_arr) and the, on set_var : "division_list" => $division_list,

The thing is that the menu appears at the begining of the html page, not in the place where is suposed to be. The cell is empty and the menu goes first, just after the headers.

                                 W H Y !? W H Y !? W H Y !? W H Y !?

I've tried EVERYTHING, and the menu still appears at the begining of the html page.

Help me please! or the next time I'll write from a mental health institution.

thanks guys-

/paula

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>