Jump to content

PHP and html


mousey

Recommended Posts

Hi, first time here so excuse me if this is in the wrong place!
Im just learning php and am havin a problem with my site.  I have a layout.php file that contains my layout code and then i have a few pages which call on this file for their layouts.
Im not sure how to explain my problem so again excuse me if it doesnt make any sense!
On my layout.php page, i have used the echo "(then the html code for my layout in here) to get the layout i want.
I've then interupted the echo function using the followng code:
(imagine this is part of my layout code)";include ("menu.php");"(then the rest of my layout code goes here.

The problem im having is that it doesnt seem to be reading the html code after i interrupt the php echo function.
I know this probably doesnt make any sense, but i cant think of a better way to describe my problem! If anyone could offer any help id greatly appreciate it!!
??? ??? ???
Link to comment
Share on other sites

If I read that right, your problem is this:
<?[color=blue]php[/color] [color=green]echo[/color] [color=red]"html"[/color]; [color=green]include[/color]([color=red]"menu.php"[/color]); [color=red]"html"[/color]; ?>

The issue:
Once you close the echo you have to reopen it:
<?[color=blue]php[/color] [color=green]echo[/color] [color=red]"html"[/color]; [color=green]include[/color]([color=red]"menu.php"[/color]); [color=green]echo[/color] [color=red]"html"[/color]; ?>

You also might try this:
<?[color=blue]php[/color] [color=green]echo[/color] [color=red]"html"[/color] . [color=green]include[/color]([color=red]'menu.php'[/color]) . [color=red]"html"[/color]; ?>

Basically the dot says there is now some php that needs to be executed before it is echoed, then the closing dot says to stop executing.
Link to comment
Share on other sites

Hello me again!
Just one more thing, I wanted to check that im doing this right and that on my layout page i have ";echo$content;" as the contents of one of my cells and that on each page of my site having $content="html code for the content of the cells"??
Thanks guys!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.