• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Server Side Includes

Guest
Oct 08, 2012 Oct 08, 2012

Copy link to clipboard

Copied

Hello,

I have setup a few Server-Side includes on various pages, but when I come to placing 2 Server Side Includes onto one page it won't allow me to do so. I am linking into files within another file but under the same domain name, here is the PHP coding I am using to do link each server side in <?php require_once('quote/rss2html.php'); ?>

can someone please help me with this?

TOPICS
Server side applications

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 08, 2012 Oct 08, 2012

Copy link to clipboard

Copied

AMant201 wrote:

here is the PHP coding I am using to do link each server side in <?php require_once('quote/rss2html.php'); ?>

Take a closer look at your code. You're using require_once(), which allows the include file to be included once and once only. If you want to include the file more than once on a page, you need to use either include() or require().

<?php require('quote/rss2html.php'); ?>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 08, 2012 Oct 08, 2012

Copy link to clipboard

Copied

Hello,

Thank you for your reply, I have tried this method and it doesn't seem to work. If you go to this page http://www.test.hdwebdesigns.co.uk/MPM/blog.php   I just need to echo the titles on that page really. That may make it easier

Thanks

Ash

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 08, 2012 Oct 08, 2012

Copy link to clipboard

Copied

All the web page shows is the HTML output, so it's hard to tell what's happening. However, looking at the HTML source code, I can see two comments that say the HTML was generated by rss2html.php, but it's not clear whether they're in your original script or whether they have been generated by the include file.

Since you're using a commercial script, it might be a good idea to get back to the company you licensed it from if it's not working as expected.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 08, 2012 Oct 08, 2012

Copy link to clipboard

Copied

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title> <?php $title="This is my Page Title"; echo $title ?>  </title>

</head>

<body>

<!--echo variable between <h1> tags-->

<h1><?php echo $title ?></h1>

<!--echo variable again between <h3> tags-->

<h3><?php echo $title ?></h3>

</body>

</html>

Nancy O.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 08, 2012 Oct 08, 2012

Copy link to clipboard

Copied

Nancy I have noticed that you placed the rss2html.php file on the blog (http://alt-web.blogspot.co.uk/) that I used for the site. I have been able to get it to work for single feeds per page. But any more than one feed per page, shall not let the 2nd feed work. Can you help me please?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2012 Oct 09, 2012

Copy link to clipboard

Copied

LATEST

You could create 2 include files:

rss2html-1.php = primary feed.

rss2html-2.php = secondary feed.

<?php require('quote/rss2html-1.php'); ?>

<?php require('quote/rss2html-2.php'); ?>

Nancy O.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines