I have an HTML form that is echoed from my php script. When I try to pass a hidden variable through the script, the code does not work as intended.
$threadNumber=$row["Tid"];
echo "<center><b>Message# ", $messageNumber , ": </b><br>";
echo $row["Mtitle"] , " in Thread# " , $row["Tid"] , "<br>";
echo "The Message was Written on " , $row["Mdate"] , '<br>';
echo $row["Mbody"];
echo "<br><br>";
echo '<form action="messageReply.php" method="post">';
echo '<textarea name="reply" rows=5 cols=30 placeholder="Reply to the Message?"></textarea>';
echo '<input type="hidden" name="Mtitle" value="<?php echo $row["Mtitle"] ?>">';
echo '<input type="submit" value="Send Message">';
echo '</form>';
The result looks like this:
and when I try to read $_POST["Mtitle"] in the messageReply.php script, I get an error saying such an index does not exist.
