PHP only substitutes variables enclosed in double quotes "
. What you want is:
echo "Old Activity Name : ". $_POST[$row['act_name']]
But your whole form does not make any sense. The output you get would be:
Old Activity Name : edit
because this is the value of the submit button.
Can you please clarify your question, what do you want to achieve? Here are some thoughts from my side:
Maybe what you want is more like:
<form action="update_act.php" method="POST">;
<input type="hidden" name="act_name" value="<?php echo $row[act_name] ?>" />
<input type="submit" name="submit" value="edit">
</form>
// ---- other file ---
<?php
echo "Old Activity Name : ".$_POST['act_name'];
?>
Why do you want to have different names for different submits ?
Do you want to differentiate between different actions? If so, it is easier you the buttons have the same name and you check against their values, e.g.:
<form action="update_act.php" method="POST">;
<input type="submit" name="submit" value="edit">
</form>
<form action="update_act.php" method="POST">;
<input type="submit" name="submit" value="delete">
</form>
and then
<?php
if($_POST['submit'] == 'edit') {
}
else if ($_POST['submit'] == 'delete') {
}