Jump to content

[SOLVED] Linking PHP and I get a parse error?? help!!


esevato

Recommended Posts

Hi,

 

I had a .HTML page

 

changed it to PHP

 

took sections of the code, and seperated them to different .PHP pages so its easier to update and then in the index.php I used the following code to link them:

 

<?php require("index_header.php"); ?>

 

and

 

<?php require("index_footer.php"); ?>

 

when i goto index.php I get the following:

 

Parse error: syntax error, unexpected T_STRING in /home/amahle/public_html/streetalbum/simplify-05/index_header.php on line 1

 

here is the code from index_header.php:

 

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"!>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-language" content="en" />
    <meta name="robots" content="all,follow" />
    <meta name="author" lang="en" content="All: ... [www.url.com]; e-mail: [email protected]" />
    <meta name="copyright" lang="en" content="Webdesign: Nuvio [www.nuvio.cz]; e-mail: [email protected]" />
    <meta name="description" content="..." />
    <meta name="keywords" content="..." />
    <link rel="stylesheet" media="screen,projection" type="text/css" href="css/reset.css" />
    <link rel="stylesheet" media="screen,projection" type="text/css" href="css/main.css" />
    <!--[if lte IE 6]><link rel="stylesheet" media="screen,projection" type="text/css" href="css/main-ie6.css" /><![endif]-->
    <link rel="stylesheet" media="screen,projection" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.innerfade.js"></script>
    <script type="text/javascript">
    $(document).ready(
    function(){
        $('#slider').innerfade({
            animationtype: 'fade',
            speed: 750,
            timeout: 3000,
            type: 'sequence',
            containerheight: 'auto'
        });
    });
    </script>
    <title>Street Album - We're Loud In The Streets!</title>
</head>

<body>

<div id="main">

    <!-- Header -->
    <div id="header" class="box">

        <p id="logo"><a href="./" title="Street Album [Go to homepage]"><img src="images/templogo.jpg" alt="Logo" /></a></p>

        <hr class="noscreen" />

        <!-- Navigation -->
        <p id="nav">
            <strong>Home</strong> <span>|</span>
            <a href="#">Mixing</a> <span>|</span>
            <a href="#">Hosting</a> <span>|</span>
            <a href="#">Promotions</a> <span>|</span>
            <a href="#">Portfolio</a> <span>|</span>
            <a href="#">About</a> <span>|</span>
            <a href="#">Contact Us</a> <span>|</span>
        </p>

    </div> <!-- /header -->

    <hr class="noscreen" />

    <!-- Promo -->
    <div id="promo">

        <p id="slogan"><img src="design/slogan.gif" alt="Place for your slogan" /></p>
        
        <ul id="slider">
            <li><img src="design/slider-01.jpg" alt="" /></li>
            <li><img src="design/slider-02.jpg" alt="" /></li>
            <li><img src="design/slider-03.jpg" alt="" /></li>
        </ul>
        
    </div> <!-- /promo -->

 

Many Thanks, any help is appreciated!

 

Esevato

 

php code must be inserted into <?php ?> brackets.

use of shortends is possible but not recommanded, its not multi-plateform friendly

<?xml version="1.0"?> is a shortend for <?php xml version="1.0" ?>

 

hence, php believes this is php code

The answer is:

disable short_open_tag in the php.ini.

OR use

 

<?php echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); ?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.