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
47
Other forums
Images outside webroot
Im hopeing someone can help me with this because i cant figure it out.I have setup an ASP.NET websit
Error in SQL Syntax HELP!!!
I have this page:
Code: <?php
session_start();
//connect to server and s
Different payment methods with different cross company requirements in F110
We are implementing SAP in a company in the shipping industry. They have the following requirement:<
quotes changing
hi all
in my content
opening quotes " changes to “
close qu
Change Sort Order to Display Newest File First
Hi Guys,
I have a page that sorts the contents (PDFs) of a directory and displays them on the
str_replace help
I am thinking str_replace is my only option to filter outputs from my database to convert them to sa
Scrolling news bar and MySQL
I am not sure if this is the correct forum to post this on. If not, I apologize. I am still pretty
Page not Loading After Test
Hey All
It seemed that an inlcude statement wasn't working for some reason, so I tried a more
Variables and Include
Code: [Select]<?php
$header = $_COOKIE['mss']['header'];
$body = $_COOKIE['mss']['b
Xml parsing
I need a suggestion about parsing xml with multiply parts like pervious...
i.e. different device