Jump to content

Form and php dropdown integrating: creates 2 dropdown instead of 1


dakke

Recommended Posts

I'm new to PHP, HTML, MySQL,... but I thought that this would be rather simple.

I want a drop down box, using values from a mysql field. It works just fine, the php that is, but when I integrate it with a form, nothing happens. This is the code:

<select name="category"> 
<?php include('php/DropdownCategory.php'); ?>
</select>

 

The actual php file works, I created a drop down. But when added to the form (this section is part of a bigger form, so the <form> tags are in place) it creates 2 drop downs. One completely empty, the other the actual php drop down. So it seems that the select does not use the php drop down, but creates an additional one. What am I doing wrong?

 

 

Link to comment
Share on other sites

You are going to have to show a lot more code that that if you want an answer (the quality and accuracy of an an answer is directly proportional to the quality and detail of the question).

 

At the very least, post the contents of dropDownCategory.php. That may be enough. But if you want to be sure, post the rest of the code for the form as well.

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.