My form button not sending var via post.
I've followed the code example in the following links.
PHP Pass variable to next page
HTML form is not sending $_POST values
Send value of submit button when form gets posted
but keep getting..
Notice: Undefined index: test in /public_html/test/seats.php on line 3
or blank page when using isset.
PAGE 1
foreach($res as $row) {
$title = $row['Title'];
$perfDate = $row['PerfDate'];
$perfTime = $row['PerfTime'];
echo "<tr>";
echo "<td>".$title."</td>";
echo "<td>".$perfDate."</td>";
echo "<td>".$perfTime."</td>";
echo "<td><form action='seats.php' method='post'>
<input type= 'hidden' name='test' value=<?php echo $title;?> />
<input type='submit' value='Submit'></form></td>";
echo "</tr>";
}
Ultimately I will be passing row info, to build an SQL query on the next PHP page, however at the moment I am unable to send the even just the $title.
Using the below code gives me nothing so the issue must be with my POST in page 1?
PAGE 2
<?php
$value = "";
$value = isset($_POST['test']) ? $_POST['test'] : '';
echo $value;
?>