[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; ?>"
onClick ="GoToNextPage(this.value)">
<?php echo $time; ?>
</label>
<?php } ?>
<?
}
}
?>
[/PHP]
The screening time can be captured by onclick attribute in javascript
Expand|Select|Wrap|Line Numbers
- function GoToNextPage(value){
- if(value != ""){
- document.location = 'reservation3.php?selected_time=' +value;
- }
- }
Expand|Select|Wrap|Line Numbers
- <tr><td><label>Showtime <?= $_GET['selected_time']; ?></label></td></tr>