Reply to Re: Source Displayed With include_once()

Your name:

Reply:


Posted by Steve on 08/06/06 16:29

Benjamin Esham wrote:
>
> It would seem that the file functions.php is not being interpreted as PHP
> code. Check your server settings to make sure that the file is placed in a
> suitable directory for inclusion.

The included file is in the same directory as the page that is including
it, and that's the way it worked in the past. Can included files only
be in the directory specified in php.ini?

>
> Also, you might make sure that your include file begins with <?php and ends
> with ?>. Otherwise, PHP has no way of knowing that your code is anything
> other than plain text.

That was one of the first things I checked.

Here are the first few lines from the functions.php:

<?
function do_html_header($title)
{
// print an HTML header
?>
<html>
<head>
<title>Shaw's Fiberglass - <?php echo $title ?></title>
<meta http-equiv="Content-Type" content="text/html;">
<meta name="keywords" content="fiberglass,fenders,front fenders,rear
fenders,running boards,classic trucks,Chevy,Chevrolet,General
Motors,GMC,Jimmy,Shaws,Shawsfiberglass,truck,trucks,replacement,custom,1941,
1942, 1943, 1944, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953,
1954,antique,street rod,restored,truck parts,hood,hoods">
<LINK REL=stylesheet HREF="shaw.css" TYPE="text/css">



Here is the php code in the calling page:

<?php
include_once("functions.php");

do_html_header("Contact Us");
?>



And here is what is displayed in view source:

<?
function do_html_header($title)
{
// print an HTML header
?>
<html>
<head>
<title>Shaw's Fiberglass - </title>
<meta http-equiv="Content-Type" content="text/html;">
<meta name="keywords" content="fiberglass,fenders,front fenders,rear
fenders,running boards,classic trucks,Chevy,Chevrolet,General
Motors,GMC,Jimmy,Shaws,Shawsfiberglass,truck,trucks,replacement,custom,1941,
1942, 1943, 1944, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953,
1954,antique,street rod,restored,truck parts,hood,hoods">
<LINK REL=stylesheet HREF="shaw.css" TYPE="text/css">

Steve

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация