how to insert php into html that is already inside php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Folcon
Forum Newbie
Posts: 6
Joined: Tue May 23, 2006 5:25 pm

how to insert php into html that is already inside php

Post by Folcon »

i think its a problem with my escaping of characters. the main problem is i havn't seen any tutorials on this so here is the code
(this is probably a very newbie problem but i hope someone can point me in the right direction)

Code: Select all

function menu()
{
echo("<div id=\"Oobj12\" style=\"position:absolute\;z-index:4\;visibility:visible\; left:1px\;top:173px\;width:165px\;height:299px\;\"> ");
echo("<div id=\"Grtf9\" class=\"dfltt\">);
include("menu.php");
echo("<br></div>");
echo("</div>");

?>
im trying to create a funtion that produces a menu in that position as my site is modular the include is to summon my menu, menu.php
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

You mean like this?

Code: Select all

<?php
function menu()
{
	echo '<div id="Oobj12" style="position:absolute;z-index:4;visibility:visible; left:1px;top:173px;width:165px;height:299px;">';
	echo '<div id="Grtf9" class="dfltt">';
	include("menu.php");
	echo '<br></div>';
	echo '</div>';
}
?>
Folcon
Forum Newbie
Posts: 6
Joined: Tue May 23, 2006 5:25 pm

Post by Folcon »

umm yes thank you very much :D
Post Reply