Forum Moderators: coopster

Message Too Old, No Replies

Drop down no result? Java+php

mixed java php code

         

Reverentx

12:29 pm on Sep 23, 2004 (gmt 0)



here is my drop down (work fine)
<?php
if(isset($_POST['submit'])) {
} else {
echo'<SELECT ID="type" NAME="type">';
echo'<OPTION VALUE="">-----CHOOSE-----</OPTION>';
include'open.php';
$sql= "SELECT * FROM contractortype ORDER BY cono DESC";
$result= mysql_query($sql,$db);
$row= mysql_fetch_array($result);
$cono=$row["cono"];
$value='1';
while ($cono>'0') {
$sql= "SELECT cono,type FROM contractortype WHERE cono='$cono'";
$result= mysql_query($sql,$db);
$row= mysql_fetch_array($result);
$type=$row["type"];
if ($type) {
echo'<OPTION VALUE"'.$value.'">'.$type.'</OPTION>';
$value++;
}
$cono=$cono-100;
}
echo'</SELECT>';
}
?>
on the same page i Refresh the page to get the result
it dont work? what wrong
i have worked with it for 3 dayes now without result?
HELP? some one have a simple solution!
<?php
if(isset($_POST['submit'])) {
$type=($_POST['type']);
if (isset($_POST['type'])) { $ok="EXIST"; }
echo "value: ", $opt," Type:",$type, " ok: ",$ok; }
?>
<form method="post"><input type="submit" onClick=popup() name="submit" value="submit" /></form>

StupidScript

4:45 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please let us know (a) what you expect from this code and (b) what is "not working" about it. There are some issues with the way it's written, but it's a little hard to tell what you are trying to do. It looks like you want to populate a SELECT form element with items from a database ...?

Also, where is the "popup()" function being defined? It's the only Javascript in the code you posted.

coopster

6:41 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Reverentx!

Also, you don't have your <select> inside your <form> tags.