Re: Problem getting included source code to work.



Yes, when include (and require) are run, the included text is parsed
like HTML, so you need to place it inside another <?php ....... ?> set.

As I understand your request, you want to keep everything separate,
which is easy enough to do:

In the file you want the public to see, first include your php code
(this included file can also have other included files in it too)

then:

<html>
<head>
<title>,,,,,,</title>
<OTHER HEAD FORMATTING>
</head>
<body>
<?php include('header.inc') ?> <-- This is your header html file, all
the content that will always be the same on every page.

TEXT, IMGS, WHATEVER <-- This is your actual content. if you want,
you could include this from a file as well.

<?php include('footer.inc') ?> <-- This is your footer html file, just
like the header, exept all the code that goes below the content.

</body>
</html>

Is that what you were asking?

.



Relevant Pages

  • Session variables and IE7
    ... I have a web page set up for doctors to request vacation. ... I use a javascript calendar and additional javascript to make sure the ... so I am looking at my PHP code first. ... Sends an email containing a vacation request and posts to database. ...
    (comp.lang.php)
  • Re: [PHP] file_get_contents
    ... BTW, Brad, I was stripping the HTML tags around the object ok, but I'm ... but it's still showing php code in the text area! ... php is transparently making a http request to the webserver there is no ... way the webserver will differentiate between your script and every other request ...
    (php.general)
  • About PHP CMS
    ... (That's how ASP.NET sort of works I think). ... If this is possible, HTML CODE, PHP CODE, AND THE CSS CODE can be completely ... separate, increasing the clarity of all the source code. ...
    (php.general)
  • Re: Contact Form
    ... > Could use some help to see if any error in php code and appreciate ... Jason ... get put into $_REQUEST is a matter of how PHP is configured, ...
    (comp.lang.php)