[ ISSUE ]: I have created a function in php that dynamically loads html blocks of code depending on the parameters I pass, the function will be utilized to load text-boxes in one page and in another page to display the answers retrieved from the text-boxes. Example:
function chapterOne($param1, $param2) {
echo 'Welcome';
echo 'My name is '. $param1;
echo 'I am from ' . $param2;
}
# The form is going to return $name or $loc values if
# any text-box is forgotten empty when form is submitted
# ---------------------------------------------------------
$p1 = '<input type="text" placeholder="name" value="<?php echo $name; ?>" >';
$p2 = '<input type="text" placeholder="loc" value="<?php echo $loc; ?>" >';
echo chapterOne($p1,$p2);
The issue is that the value shows the php code instead of the placeholder, but only happens dynamically, when I test regular it works. Any thoughts or feedback how to overcome this issue?
Textbox example: