$_POST Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinceboy
    New Member
    • Sep 2007
    • 22

    $_POST Problem

    Hi...guys! I have a form which consists of drop down menu and radio button..I would like to output the selected value in next page by using $_POST.How can capture them?It is urgent for me,thanks for generious help

    Code:
     <select name="rNumber" title="number of ticket">
                          <option selected>Select</option>
                          <option>01</option>
                          <option>02</option>
                          <option>03</option>
                          <option>04</option>
                          <option>05</option>
                          <option>06</option>
    </select>


    [PHP]

    <?
    if (isset($_SESSIO N['gmemberid'])) {

    $tbl_name = "movie";
    $result = mysql_query(spr intf('SELECT name,classifica tion,screeningT ime FROM %s
    LIMIT 7', $tbl_name)) or die('Cannot execute query.');


    //$numrow = mysql_num_rows( $result);


    while ($rows = mysql_fetch_ass oc($result)) {
    echo '<table width="100%" border="0"><tr> <td height="68">
    <table width="100%" height="47" border="0">
    -----------------------------------------<br>';

    echo '<strong>' . $rows['name'] . ' (' . $rows['classification '] . ')
    <br></strong>';
    foreach (explode(',', $rows['screeningTime']) as $time) { ?>
    <label>
    <input type="radio" name="time[<?php echo $rows['name']; ?>]"
    title ="screening time" value="<?php echo $time; ?>">

    <?php echo $time; ?>&nbsp;&nbsp;& nbsp;
    </label>
    <?php } ?>
    <?
    }

    }
    ?>

    [/PHP]
    Last edited by Atli; Sep 27 '07, 01:42 AM. Reason: Made the long line of --- shorter so it would fit better.
  • brettl
    New Member
    • Sep 2007
    • 41

    #2
    If you're using the method=post in your form you can call the variable by using $_POST["rNumber"] you could even use $_REQUEST["rNumber"]

    Comment

    • vinceboy
      New Member
      • Sep 2007
      • 22

      #3
      Thanks.Then how can display 'name' and 'screening time' by using $_POST or $_REQUEST??Both of them are dynamically display in PHP

      Comment

      • brettl
        New Member
        • Sep 2007
        • 41

        #4
        Take a look at http://us.php.net/manual/en/reserved.variables.php
        $_REQUEST creates an associative array consisting of the contents of $_GET, $_POST, and $_COOKIE.

        Comment

        Working...