Jump to content

Recommended Posts

how can i pick selected value entered by user in the next form from this combobox..

 

 

 

<?php

 

include('connect.php');

 

$Tb = "mem_master";

 

mysql_select_db($Db, $link);

                           

$query = "select mem_id from mem_master order by mem_id";

 

$result= mysql_query($query,$link);

 

$fel=mysql_num_fields($result);

$nro=mysql_num_rows($result);

 

if ($nro>0)

 

{

   

    echo "<select name='item'>\n";

       

    echo "<option>-- Select Item --</option>\n";   

       

    while ($row=mysql_fetch_array($result))

 

    {

   

            echo "<option value='$row[item]'>$row[mem_id]</option>\n";

       

    }                       

                             

}

 

mysql_close($link);

 

?>

Link to comment
https://forums.phpfreaks.com/topic/186662-how-to-pick-combo/
Share on other sites

i dont quite understand your question, but if you want the value entered in the select box, on whatever page that form submits to, you can access the value like so

$value = $_POST['item'];

 

its $_POST['item'] because "item" is the name of the form

Link to comment
https://forums.phpfreaks.com/topic/186662-how-to-pick-combo/#findComment-985825
Share on other sites

NOT WORKING

 

i dont quite understand your question, but if you want the value entered in the select box, on whatever page that form submits to, you can access the value like so

$value = $_POST['item'];

 

its $_POST['item'] because "item" is the name of the form

Link to comment
https://forums.phpfreaks.com/topic/186662-how-to-pick-combo/#findComment-985829
Share on other sites

complete code

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

<style type="text/css">

<!--

.style4 {font-size: 36px}

-->

</style>

</head>

<body>

<div align="center"><img src="images/libimage.jpg" width="998" height="103" /></div>

<p> </p>

<table width="572" height="61" align="center">

  <tr>

    <td align="center" valign="middle"><p class="style4">MEMBER SEARCH</p>

    <p><a href="index.html"><img src="images/mainmenu.gif" width="128" height="40" /></a><span class="style4"><a href="membermaster.html"><a href="membermaster.html"><img src="images/return.gif" width="128" height="40" /></a></span></p></td>

  </tr>

</table>

<p> </p>

<form name="memmaster" method="post" action="memmodify.php">

<table width="259" border="0" align="center">

  <tr>

    <td width="105">Member Id</td>

    <td width="144">

 

 

 

    <?php

 

include('connect.php');

 

$Tb = "mem_master";

 

mysql_select_db($Db, $link);

                           

$query = "select mem_id from mem_master order by mem_id";

 

$result= mysql_query($query,$link);

 

$fel=mysql_num_fields($result);

$nro=mysql_num_rows($result);

 

if ($nro>0)

 

{

   

    echo "<select name='item'>\n";

       

    echo "<option>-- Select Item --</option>\n";   

       

    while ($row=mysql_fetch_array($result))

 

    {

   

            echo "<option value='$row[item]'>$row[mem_id]</option>\n";

       

    }                       

                             

}

 

mysql_close($link);

 

?>

   

   

   

    </td>

  </tr>

</table>

<p> </p>

<table width="129" border="0" align="center">

  <tr>

    <td width="66"><input name="cmdsubmit" type="submit" id="cmdsubmit" value="Search" /></td>

    <td width="53"><input type="reset" name="cmdclear" id="cmdclear" value="Clear" /></td>

  </tr>

</table>

 

<p> </p>

<p> </p>

<p> </p>

 

</body>

 

</html>

 

 

 

 

 

memmodify.php

 

<?php

 

$memval=$_POST['item'];;

 

 

include('connect.php');

$Tb = "mem_master";

 

mysql_select_db($Db, $link);

                           

$query = "select * from mem_master where mem_id='$memval'";

 

$result= mysql_query($query,$link);

 

$fel=mysql_num_fields($result);

$nro=mysql_num_rows($result);

 

 

Link to comment
https://forums.phpfreaks.com/topic/186662-how-to-pick-combo/#findComment-985830
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.