Jump to content

Dynamic Listy Boxes


jenniferG

Recommended Posts

we are trying to  buid some dynamic list boxes.  Our  code that  generates the

listbox  creates  a string  containing the list box definition and the  last line of the  file

is echo  $outstr.  When we  execute this, the list box works fine. Now when we embed it into am html page  in this way: <?php  include statuslistbox.php  ?>, we get  errors  that  say "constant  statuslistbox.php  not defined"  The listbox define file has  the php brackets  top and bottom. The embeding html has no brackets other than the

ones show above. It seems to make no difference  if the calling file  is a php extension html extension.

Thanks,

Jennifer       

Link to comment
Share on other sites

You first ensure that the page is a php page.

 

//here goes the query that access the data from the database

//close php tag

<select name="mylist">

<option value="<?php $result_of_query?>"><?php $result_of_query?></option>

</select>

//for other processing start and close the php tag as required.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.