html - php from action value get from drop-down list -
html - php from action value get from drop-down list -
my goal 2 drop downwards values , 1. pass them action
, 2. pass them $_post
next .php
page. in short want select action
php page using drop-down
menu.
what doing wrong here, whatever select page
drop-down menu default select page1.php
<html> <body> <select name='page'> <option value='page1.php'>page1</option> <option value='page2.php'>page2</option> </select> <form name="page" method="post" action="<?php echo $_post['page']; ?>"> <?php // db connection info: include 'db_connection.php'; $sql = "show tables"; $result = mysql_query($sql); echo "<select name='param1'>"; while ($row = mysql_fetch_array($result)) { echo "<option value='" . $row['tables_in_radius'] . "'>" . $row['tables_in_radius'] . "</option>"; } echo "</select>"; ?> <input type="submit" value="send"> </form> <?php if(isset($_post['param1'])){ } ?> </body> </html>
1) place drop downwards within form.
2) if(isset($_post['param1'])) <-- param1 ? alter : $_post['page']
php html forms drop-down-menu
Comments
Post a Comment