Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Include Syntax - Dreamweaver

Status
Not open for further replies.

SeaninSeattle

IS-IT--Management
Sep 17, 2001
53
US
I need a little assistance. I'm trying to include a menu system at the top of my webpage, and have need to insert an include in every page (the include has the menu system in it).

I'm using Dreamweaver CS3 - and when I do a server side include (in php), the link is made, and the include functions, but when I look at the design view window, all I see is trash that appears to be from the menu system (as opposed to the page that contains the single include command, then all the other stuff on that page).

When I append the command with a straight php include command, I can see the page in the design view, however when I load it, it says the syntax is wrong, and the page fails to load.

The command which results in a working include, but no design view is (the include is contained in a table):

<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<?php require_once('../../includes/navmenu/navbar.php'); ?>
</td>
</tr>
</table>

That works - but no view. The one with a view, but does not work is:

<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<?php include(<?php require_once('../../includes/navmenu/navbar.php'); ?>
</td>
</tr>
</table>

I'm going to cross-post this to the PHP board as well - but any input would be greatly appreciated.

Thanks,
//sse

~~~~~~~~~~~~~~~~~~~~~~~~~~
Sean Engle
ssengle@worldnet.att.net
~~~~~~~~~~~~~~~~~~~~~~~~~~
"When you get to the end of
your rope - tie a knot, and
hang on!" ~ FDR
 
you won't see the content of the include in design view. If it works in a browser it is correct.


the syntax of this IS messed up
Code:
<?php include(<?php require_once('../../includes/navmenu/navbar.php'); ?>


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Thanks Chris...

Well, when I do the >Insert>ServerSideInclude in Dreamweaver, resulting in:

<?php require_once('../../includes/navmenu/navbar.php'); ?>

The page works:


but what I see in design view (in the Dreamweaver application) looks like the attached...

And I've removed the table - the include is by itself...

Thanks,
//sse

~~~~~~~~~~~~~~~~~~~~~~~~~~
Sean Engle
ssengle@worldnet.att.net
~~~~~~~~~~~~~~~~~~~~~~~~~~
"When you get to the end of
your rope - tie a knot, and
hang on!" ~ FDR
 
design view isn't using the CSS to render the page (nothing new there then)

That's why I NEVER look at anything in design view, it's of less use for checking your layout, than it is checking it in Internet Explorer and expecting it look the same in real browsers



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top