jenniferG Posted July 27, 2007 Share Posted July 27, 2007 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 https://forums.phpfreaks.com/topic/61951-dynamic-listy-boxes/ Share on other sites More sharing options...
pocobueno1388 Posted July 27, 2007 Share Posted July 27, 2007 <?php include 'statuslistbox.php'; ?> Your forgot the quotes, and ending semi-colon. Try it that way. Link to comment https://forums.phpfreaks.com/topic/61951-dynamic-listy-boxes/#findComment-308485 Share on other sites More sharing options...
ballhogjoni Posted July 27, 2007 Share Posted July 27, 2007 you can't add php to a html file. Link to comment https://forums.phpfreaks.com/topic/61951-dynamic-listy-boxes/#findComment-308487 Share on other sites More sharing options...
rameshfaj Posted July 27, 2007 Share Posted July 27, 2007 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 https://forums.phpfreaks.com/topic/61951-dynamic-listy-boxes/#findComment-308524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.