| | |
drop down menu not being populated
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
this code was working fine until i changed the way the site loads the content (it now loads the content into a div tag) and since then it will not populate the menu.
the page can be viewed at
this site
you will need to go to the sub links on the left and click the Register Interest in Courses link.
here is the code that is not working
any help would be great with this.
i know it has something to do with how i am echoing the information out.
the page can be viewed at
this site
you will need to go to the sub links on the left and click the Register Interest in Courses link.
here is the code that is not working
PHP Syntax (Toggle Plain Text)
case 10: echo''; $db = "pipdb"; $con = mysql_connect("localhost","pip","piptables")or die(mysql_error()); mysql_select_db($db)or die(mysql_error()); $query="SELECT id, title FROM training"; $result = mysql_query($query) or die(mysql_error()); $options = ""; while ($row=mysql_fetch_array($result)) { $id = $row['id']; $title = $row['title']; $options.="<OPTION VALUE=\"$id\">".$title; } echo'<form action=\"insert_interest.php\" method=\"POST\"> <h4>Select which course you would like to register your interest in</h4> <h5>Option 1</h5> <select name=\"radio\"> <OPTION VALUE=0>Please select an option <?=$options?> </select> <h5>Option 2</h5> (only select more options if needed)<br /> <br /> <select name="radio1"> <OPTION VALUE=0>Please select an option <?=$options?> </select> <h5>Option 3</h5> <select name="radio2"> <OPTION VALUE=0>Please select an option <?=$options?> </select> <br /><br /><h4>Enter the required information</h4> <b>Name:</b><br /> <input type="text" name="name" /><br /> <b>Address:</b><br /> <textarea cols="50" rows="7" name="address" onkeyup="textLimit(this, 150);"></textarea><br /> <b>Housing Association:</b><br /> <input type="text" name="housing" /><br /> <b>Email:</b><br /> <input type="text" name="email" /><br /> <br /> <input type="submit" value="Register Interest" /> </p> </form>'; break;
any help would be great with this.
i know it has something to do with how i am echoing the information out.
Pretty straight forward. You are having <?=$options?> in echo.
End the echo statement then echo $options.
Example,
End the echo statement then echo $options.
Example,
php Syntax (Toggle Plain Text)
echo'<form action=\"insert_interest.php\" method=\"POST\"> <h4>Select which course you would like to register your interest in</h4> <h5>Option 1</h5> <select name=\"radio\"> <OPTION VALUE=0>Please select an option'; echo $options; echo '</select> <h5>Option 2</h5> (only select more options if needed)<br /> <br /> <select name="radio1"> <OPTION VALUE=0>Please select an option'; echo $options; //and so on...
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
Similar Threads
- Dynamic drop down box, populated from MySQL Db (JavaScript / DHTML / AJAX)
- need some help with a dynamically populated dropdown menu... (PHP)
- How do I get a drop down jump menu to submit? (PHP)
- opopulate textfields based on drop down menu selection (ColdFusion)
- Table Populated by Database when picked by menu (PHP)
- Problem with jsp include directive in iPlanet. Working in Tomcat. (JSP)
- Is it possible to pass hidden value in <select> drop down menu? (PHP)
- Help with dynamic menu (HTML and CSS)
Other Threads in the PHP Forum
- Previous Thread: The specified CGI application misbehaved by not returning a complete set of HTTP head
- Next Thread: i can't load my image in preview
| Thread Tools | Search this Thread |
# 5.2.10 ajax apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date display dissertation dynamic echo echo$_get[x]changingitintovariable... email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link local login loop mail memberships menu mlm multiple mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote rss script search server sessions sms soap sockets source space spam sql syntax system table tutorial update upload url validation validator variable video web xml youtube






