Connecting Tech Pros Worldwide Forums | Help | Site Map

$_POST Problem

Newbie
 
Join Date: Sep 2007
Posts: 22
#1: Sep 25 '07
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

Expand|Select|Wrap|Line Numbers
  1.  <select name="rNumber" title="number of ticket">
  2.                       <option selected>Select</option>
  3.                       <option>01</option>
  4.                       <option>02</option>
  5.                       <option>03</option>
  6.                       <option>04</option>
  7.                       <option>05</option>
  8.                       <option>06</option>
  9. </select>
  10.  


[PHP]

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

$tbl_name = "movie";
$result = mysql_query(sprintf('SELECT name,classification,screeningTime FROM %s
LIMIT 7', $tbl_name)) or die('Cannot execute query.');


//$numrow = mysql_num_rows($result);


while ($rows = mysql_fetch_assoc($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]

brettl's Avatar
Member
 
Join Date: Sep 2007
Posts: 38
#2: Sep 25 '07

re: $_POST Problem


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"]
Newbie
 
Join Date: Sep 2007
Posts: 22
#3: Sep 26 '07

re: $_POST Problem


Thanks.Then how can display 'name' and 'screening time' by using $_POST or $_REQUEST??Both of them are dynamically display in PHP
brettl's Avatar
Member
 
Join Date: Sep 2007
Posts: 38
#4: Sep 26 '07

re: $_POST Problem


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.
Reply