1
slyss
Help to load a SELECT MENU
  • 2007/11/22 23:05

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


Hi all

i need help to load a SELECT MENU

in my DB i have a field stored like this:

a:4:{s:13:"italia-verona";s:15:"Italia - Verona";s:13:"italia-milano";s:15:"Italia - Milano";s:16:"brasil-fortaleza";s:18:"Brasil - Fortaleza";s:15:"brasil-salvador";s:17:"Brasil - Salvador";}


i need to have this:

$var1: italia-verona
$var2: italia-milano
.....

can you help me?

or can you tell me how i can use xoopsformloader?

thanks a lot
[size=x-large]2008 Xoops Book[/size]

2
Alex_Grey
Re: Help to load a SELECT MENU
  • 2007/11/23 1:13

  • Alex_Grey

  • Just popping in

  • Posts: 43

  • Since: 2007/6/16


this is how to use it.

example.
include 'mainfile.php';
include 
'header.php';    
include_once 
XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$my_form = new XoopsThemeForm("form title""form name""action""post"true); //post is method.

$drop = new XoopsFormSelect('some caption','item_name');
$options_array = array();
$options_array unserialize('a:4:{s:13:"italia-verona";s:15:"Italia - Verona";s:13:"italia-milano";s:15:"Italia - Milano";s:16:"brasil-fortaleza";s:18:"Brasil - Fortaleza";s:15:"brasil-salvador";s:17:"Brasil - Salvador";}');
$drop->addOptionArray($options_array);

$my_form->addElement($drop);
$my_form->addElement(new XoopsFormHidden("op""op_name"));
$my_form->addElement(new XoopsFormButton("""submit"_SUBMIT"submit"));
$my_form->display();
include 
'footer.php';
?>
“There is nothing impossible to him who will try.” ~Alex The Great~
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

3
slyss
Re: Help to load a SELECT MENU
  • 2007/11/25 9:29

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


thanks a lot man!
[size=x-large]2008 Xoops Book[/size]

Login

Who's Online

310 user(s) are online (241 user(s) are browsing Support Forums)


Members: 0


Guests: 310


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits