Date: 03/27/01
- Next message: Murthy: "[phplib] Protocol Adapter"
- Previous message: paula: "[phplib] templates and menus - HELP!!"
- In reply to: paula: "[phplib] templates and menus - HELP!!"
- Next in thread: Eric Naujock : "Re: [phplib] templates and menus - HELP!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Dear Paulita,
The problem relies on the fact that everytime you make a call to the
function MenuMaker the outputs is sent to the browser directly and not at
the end of the script and then returned to where it should be....
In other words, use a simple temp variable and use the "return" at the end
of the function:
as:
function MenuMaker($form_name,$select_name,$act,$my_arr) {
$mnu= "\n";
$mnu.= '<form name="'.$form_name.'" method="post"
action="'.$act.'">'."\n";
$mnu.= '<select name='.$select_name.'>'."\n";
while (list($key,$value)=each($my_arr)) {
$mnu.='<option value='.ereg_replace("
","_",$value).'>'.$value.'</option>'."\n";
}
$mnu.='</select>'."\n";
$mnu.='<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";
$mnu.='</form>'."\n";
return $mnu;
}
look that $mnu has a "." before "=" as it is appending each part of the
string to the variable so it can be returned as the function result. (very
similar to pascal, without return it works like a "procedure")
This might resolve your problem :)
Kindest Regards from Mexico
Enrique Motilla
www.emoi.net
----- Original Message -----
From: "paula" <paula <email protected>>
To: <phplib <email protected>>
Sent: Tuesday, March 27, 2001 4:20 PM
Subject: [phplib] templates and menus - HELP!!
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>
- Next message: Murthy: "[phplib] Protocol Adapter"
- Previous message: paula: "[phplib] templates and menus - HELP!!"
- In reply to: paula: "[phplib] templates and menus - HELP!!"
- Next in thread: Eric Naujock : "Re: [phplib] templates and menus - HELP!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

