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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.