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 strongm 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 Dreamweaver 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
 
Of course that doesn't work. Thats just wrong. What do you want to do include it or require it once?

You either include or require, and you can't have 2 PHP opening tags <?PHP

Code:
<?php include('../../includes/navmenu/navbar.php'); ?>


Ohh and you wont; get the menu n design view, because Dreamweaver does not parse PHP. Once you run it through your server you'll get everything loaded as it is supposed to.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top