2

Here is my code

<?
include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/path.php");

include $_SERVER['DOCUMENT_ROOT'] . "/inc/category_functions.php";

if (!$go4th) {
    die();
}

$content_links = content_links('tbl_content', 'content_id', 'title', '');

$content_id = 1; // home page content ID
$content = get_record('tbl_content', 'content_id', $content_id);
if ($content->show_title == 1) {
    $title = '<div class="content-title">' . $content->title . '</div>';
}

if ($content->page_title) { $page_title = $content->page_title; }
else if ($content->title) { $page_title = $content->title; }

if ($content->meta_keywords)    { $meta_keywords = $content->meta_keywords; } 
else                            { $meta_keywords = $META_KEYWORDS; }

if ($content->meta_description) { $meta_description = $content->meta_description; } 
else                            { $meta_description = $META_DESCRIPTION; }

// display the template
include $_SERVER['DOCUMENT_ROOT'] . "/inc/inside/email_list_popup.php"; //email list popup, first15 promo, etc
include $_SERVER['DOCUMENT_ROOT'] . "/template/" . $SITE_THEME . "/index.php";
?>

And this is what is displaying when I load it on my WAMP server

show_title == 1) { $title = ' ' . $content->title . ' '; } if ($content->page_title) { $page_title = $content->page_title; } else if ($content->title) { $page_title = $content->title; } if ($content->meta_keywords) { $meta_keywords = $content->meta_keywords; } else { $meta_keywords = $META_KEYWORDS; } if ($content->meta_description) { $meta_description = $content->meta_description; } else { $meta_description = $META_DESCRIPTION; } // display the template include $_SERVER['DOCUMENT_ROOT'] . "/inc/inside/email_list_popup.php"; //email list popup, first15 promo, etc include $_SERVER['DOCUMENT_ROOT'] . "/template/" . $SITE_THEME . "/index.php"; ?>

It is like it is treating the > in $content-> as a closing bracket for HTML.

This is my .htaccess

Options -MultiViews
RewriteEngine on
RewriteRule ^category/[0-9A-Za-z\-]+/c?([0-9]+)?m?([0-9]+)?p?([g0-9]+)?a?(1)?n?(1)?s?(1)?/?$ /category.php?category_id=$1&manufacturer_id=$2&page=$3&all=$4&new=$5&sale=$6
RewriteRule ^manufacturer/[0-9A-Za-z\-]+/([0-9]+)/?([0-9]+)?/?$ /category.php?manufacturer_id=$1&category_id=$2
RewriteRule ^item/[0-9A-Za-z\-]+/([0-9]+)/?p?-?([g0-9]+)?c?([0-9]+)?m?([0-9]+)?/?$ /item.php?item_id=$1&page=$2&category_id=$3&manufacturer_id=$4
RewriteRule ^content/[0-9A-Za-z\-]+/([0-9]+)/?$ /content.php?content_id=$1
RewriteRule ^sale/?$ /category.php?sale=1
RewriteRule ^new/?$ /category.php?new=1
RewriteRule ^all/?$ /category.php?all=1
RewriteRule ^all_manufacturers/?$ /category.php?all_mfg=1

<FilesMatch "\.(ttf|eot|svg|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>

<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>
4

1 回答 1

6

看起来像一个 php-tag 错误。

解决方案:

  • 更改<?<?php

或者

  • 更改short_open_tag=Onphp.ini 中的选项

希望能帮助到你

于 2013-10-31T13:58:17.907 回答