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

Weekly Calendar
Hi, I am looking at creating a weekly calendar. The calendar will read from Monday - Sunday. Does an

Creating a unique 'control panel' for each user
Hi there,

I'm thinking of designing a site that will allow users to sign up and have their ow

How to disable direct access to a file
Suppose I've 2 Files. 1.php & 2.php

I don't want anybody to access 2.php directly fr

Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,

I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.

CALL FUNCT

Recode Abap Dynpro into Web Dynpro
Hi All,
A client has asked us to look at rearchitecting a custom transaction that was developed

PHP and Javascript
Hi Guys,

Im trying to load the contents of an html file into a text area for editing, this is

regex for quoted text within a string
I am still getting the hang of regex expressions, but I cant seem to figure out how I would escape q

How to know if online site made with PHP
Hello,
I see some sites that does not display extensions at all , for example:

www.site.co

Syntax Help
Code:


im having trouble with that code snipped
Parse error: syntax error, unexpec

ME54/ME54N Conditional check for Release of PR
Hi Gurus,

My requirement is to put a check on the release of the PR with respect to the c

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