I am reworking a school project and in php code I need to insert html markup with php code inside. Confused with quotes. Here is what you need to insert into php code:
$txt = "<form> <table> <tr> <td style='text-align: center'><strong>Инвентарь</strong></td> <td style='text-align: center'><strong>Метод</strong></td> <td style='text-align: center'><strong>Номер род. кат.</strong></td> <td style='text-align: center'><strong>Уровень</strong></td> </tr> <tr> <td> <?php echo '<select name="inv_name">'; $query = mysqli_query($link,'select * from inventory'); if(mysqli_num_rows($query)) while($inv = mysqli_fetch_array($query)) echo '<option value="'.$inv["id_inventory"].'">'.$inv["name"].'</option>'; echo '</select>'; ?> </td> <td><input name='method_name' type='text' id='method_name'></td> <td><input name='method_pid' type='text' id='method_pid'></td> <td><input name='method_level' type='text' id='method_level'></td> </tr> <tr> <td colspan='4' style='text-align: center'><input type='submit' value='Добавить запись'></td> </tr> </table> </form>";
HTMLandPHP! Share the logic and presentation finally, tea dinosaurs are already extinct. - user207618HTML. And use theHEREDOCsyntax - this willHEREDOCproblems with quotes. - user207618 4:16 pm