WordPress.org

Ready to get started?Download WordPress

Forums

Allow PHP in Posts and Pages
Drop-Down List Not Working (1 post)

  1. owentech
    Member
    Posted 1 year ago #

    Hi,

    I have the following code:

    <tr>
    <td align="right" valign="top" width="50%">1) Select a County Here</td>
    <td valign="top"><select name="cbocounty">
    <option value="0">All Counties</option>
    [allowphp]
    $countysql="SELECT * FROM tblcounties order by countyname";
    $mydata = mysql_query($countysql) or die(mysql_error());
    
    while ($myrow = mysql_fetch_array($mydata)){
    $countyid = $myrow['countyid'];
    $countyname = $myrow['countyname'];
    echo '<option value='.$countyid.'>';
    echo $countyname;
    echo '</option>';
    }
    [/allowphp]
    </select>
    </td>
    </tr>

    It should show a drop-down list with county names, but the following HTML results instead:

    <tr>
    <td align="right" valign="top" width="50%">1) Select a County Here</td>
    <td valign="top">
    <select name="cbocounty">
    <option value="0">All Counties</option>
    <p>
    Kiambu
    
    Machakos
    
    Mombasa
    
    Nairobi
    <br />
    
    </select>
    </td>
    </tr>

    Please advise.

    http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic