I’am styling my webpage and in my function.php file I have written some code which I wanna access from the elementor html code button.
<td width='25%'><input type='text' id='uptname' name='uptname' value=<?php echo $name ?></td>
the value is not printed. normally the value from my database is supposed to be displayed. Thats my part in the functions.php file.
if (isset($_GET['upt'])) {
$upt_id = $_GET['up'];
$result = $wpdb->get_results("SELECT * FROM gemeinde WHERE id='$upt_id'");
foreach($result as $print) {
$name = $print->name;
}
}
either the id field or the gemeinde field is supposed to show the results from my database.
2
Answers
You should try:
<td width='25%'><input type='text' id='uptname' name='uptname' value='<?php echo $name ?>'></td>
You just forgot to put quotes around
<?php ... ?>
and close correctly the<td>
node.Change
To
And
Change
To
** The attribute value can remain unquoted if it doesn’t contain spaces or any of " or ‘ . Otherwise, it has to be quoted using either single or double quotes. The value, along with the = character, can be omitted altogether if the value is the empty string.