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

Did you know?Explore Trending and Topic pages for more stories like this.
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

LinkedList help
Ok so I just learned quickly about lists, so I have a not too hard project I think, but am having a

limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter h

download directory onto C drive
I am attempting (if this is possible) to write a routine to automatically dump the contents of a dir

show random images
hey guys

can someone please suggest a way in which the following code can be edited so it onl

Regarding accessing SQL query issued by any user in Oracle 10g
Hi all,
i want to know the queries issued by various users accessing a database...

PHP Game
hy i was wondering what's the best method in order to make some automatic updates in a php game
<

switch form actions? not working
i want on submit to go to different pages according to the CatID

Code: <?php $CatID=$_

Confusing Functions
So, I've been reading up on Functions and I like them! However, I need some help using variables in

Count of reciepients in php mailer
How can i sent a mail to large no of reciepients say 10,00,00 Using PHP MAILER

Insert Failing.
Hey,
I am making a Sign up page for a website, but the insert query into the Database does not se

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