need help in dynamic select menu in php


Posted on 16th Feb 2014 07:03 pm by admin

hi i have created a dynamic select menu using php. i have a problem in that which is when the user select any value in that menu and press submit then it does not pass to next page.

my code is here

Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>

<body>
<?php
$db = mysql_connect("localhost");
mysql_select_db("test", $db);
$query = "SELECT * FROM day" or die(mysql_error()); // id='".$id."'
//echo $query;
$result = mysql_query($query) or die(mysql_error());


?>
<form name="form1" method="post" action="date.php">
<label>Date:
<select name="day" id="day">
<?php while( $row = mysql_fetch_array($result) ) { ?>
<option value="<?php $row['id']; ?>"><?php echo $row['day']; ?></option>
<?php } ?>
</select>
</label>
<p>
<label>
<input type="submit" name="button" id="button" value="Submit">
</label>
</p>
</form>
</body>
</html>

the next page is
Code: <?php
$day = $_POST["day"];

echo $day;
?>

No comments posted yet

Your Answer:

Login to answer
305 Like 47 Dislike
Previous forums Next forums
Other forums

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

generating all possible random letters
hi'

how can i randomize the letters a,b,c,d,e all possible ways, and i want to print the res

Force download script not handling files with spaces properly
I have a regular old php force download script, uses this code:

Code: header("Cache-Cont

Beginner question regarding Array's
Hi everyone, the page im working on has an array of variable at the top...

Code: $define_li

what business processes?
Hi,

A general question. What business processes (like OTC - Order to Cach, P2P, R2R etc)

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

Sequencing or queuing parallel process
Scenario is as follows
There is one parent process say P1 and 4 child processes say A B C D

Count number of records in all the tables with a querry URGENT PLEASE...
I downloaded ORACLE 9I DATA DUMP into my comp. There are number of tables. I need to find out the

Simpler method of getting variables from mysql
Hi Guys,

I'm trying to streamline my CMS's code and as I was writing a new page it occured to

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash