Query String

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Blackwell

    Query String

    How do you put the value of a form field into the query string. I have a
    select field named title on a submission form. I'd like the selected value
    to be put on the Form line

    echo "<form name='form1' method='post'
    action='admin/edit.php?select field=what goes here? '>";

    thanks for looking.


    function load()
    {
    require_once(". ./login.php");
    login();

    mysql_select_db ("db");
    $options = "select id from table order by id";
    $optres = mysql_query($op tions);

    $opt_results = mysql_num_rows( $optres);
    echo "<select name=title>";

    for ($i=0; $i <$opt_results ; $i++)
    {
    $optrow = mysql_fetch_arr ay($optres);
    $optionval = stripslashes($o ptrow["song"]);
    echo "<option>$optio nval</option>";
    echo "<br>";
    }
    echo "</select>";
    echo "</p>";

    echo "<form name='form1' method='post'
    action='admin/edit_tab.php?ta b='>";


    echo "<input type=\"submit\" name=\"edittab\ " value=\"edit tab\">";
    echo "</form>";


  • neur0maniak

    #2
    Re: Query String

    What you want is the GET method, instead of the POST method
    [color=blue]
    > echo "<form name='form1' method='post'
    > action='admin/edit.php?select field=what goes here? '>";[/color]

    echo "<form name='form1' method='get'
    action='admin/edit.php'>";




    Tim Blackwell wrote:[color=blue]
    > How do you put the value of a form field into the query string. I have a
    > select field named title on a submission form. I'd like the selected value
    > to be put on the Form line
    >
    > echo "<form name='form1' method='post'
    > action='admin/edit.php?select field=what goes here? '>
    >
    > thanks for looking.
    >
    >
    > function load()
    > {
    > require_once(". ./login.php");
    > login();
    >
    > mysql_select_db ("db");
    > $options = "select id from table order by id";
    > $optres = mysql_query($op tions);
    >
    > $opt_results = mysql_num_rows( $optres);
    > echo "<select name=title>";
    >
    > for ($i=0; $i <$opt_results ; $i++)
    > {
    > $optrow = mysql_fetch_arr ay($optres);
    > $optionval = stripslashes($o ptrow["song"]);
    > echo "<option>$optio nval</option>";
    > echo "<br>";
    > }
    > echo "</select>";
    > echo "</p>";
    >
    > echo "<form name='form1' method='post'
    > action='admin/edit_tab.php?ta b='>";
    >
    >
    > echo "<input type=\"submit\" name=\"edittab\ " value=\"edit tab\">";
    > echo "</form>";
    >
    >[/color]

    Comment

    Working...