Jump to content

[SOLVED] Echo/Include Problems


Timma

Recommended Posts

Not sure what the problem could be...

 

Parse error: syntax error, unexpected T_INCLUDE, expecting ',' or ';' in *****\index.php on line 8

 

<?php $page = basename($_SERVER['QUERY_STRING']);
include('includes/header.php');

echo "
<table width='1024' border='0' cellspacing='0' cellpadding='0'>
  <tr>
    <td width='150'>"
include('includes/nav.php');
"</td>
    <td width='12'> </td>
    <td width='700'>"
if(!$page){
include('pages/main.php');
} else {
if(file_exists('pages/'.$page.'.php')){
include('pages/'.$page.'.php');
} else {
echo('This page does not exist!');
} 
}
"</td>
    <td width='162'> </td>
  </tr>
</table>
";


include('includes/footer.php');
?>

Link to comment
Share on other sites

Ehrm.. you need to close your echo statements with ;

 

for example:

echo "
<table width='1024' border='0' cellspacing='0' cellpadding='0'>
  <tr>
    <td width='150'>";

 

And you have several other places with this error as well. Correct it everywhere.

Link to comment
Share on other sites


<?php 
$page = basename($_SERVER['QUERY_STRING']);
include('includes/header.php');

$content = "";

$content .= "<table width='1024' border='0' cellspacing='0' cellpadding='0'><tr><td width='150'>";
$content .= include('includes/nav.php');
$content .= "</td><td width='12'> </td><td width='700'>";
if(!$page){
$content .= include('pages/main.php');
} else {
if(file_exists('pages/'.$page.'.php')){
$content .= include('pages/'.$page.'.php');
} else {
$content .= echo('This page does not exist!');
} 
}
$content .="</td><td width='162'> </td></tr></table>";

print $content;
include('includes/footer.php');
?>

Link to comment
Share on other sites

check this out

u can't assign echo to some variable

 

<?php

$page = basename($_SERVER['QUERY_STRING']);

include('includes/header.php');

$content = "";

$content .= "<table width='1024' border='0' cellspacing='0' cellpadding='0'><tr><td width='150'>";

$content .= include('includes/nav.php');

$content .= "</td><td width='12'> </td><td width='700'>";

if(!$page){

$content .= include('pages/main.php');

} else {

if (file_exists('pages/'.$page.'.php')){

$content .= include('pages/'.$page.'.php');

} else {

$content .= 'This page does not exist!';

}

}

$content .="</td><td width='162'> </td></tr></table>";

print $content;

include('includes/footer.php');

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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