Jump to content


Photo

PHP echo question please help is this possible?


  • Please log in to reply
2 replies to this topic

#1 mtanner

mtanner
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 August 2006 - 05:15 AM

Firstly, Thanks in advance. 

My question, and hopefully it can be understood and answered as simple as possible is, I am trying to echo a php include is this possible? I have a CMS (cutenews) that allows me to use templates and include them via php into my design. On top of that I am using an ajax dynamic tab script for my navigation that echos content from a file content.php. yes, yes I understand this is not conventional, valid or accesable, but I like it. What i am trying to do is instead of echo-ing text I want to echo the cms php include like thus...

content.php

<?php

if ($_GET['content'] == 1) {
echo '<?PHP
$number=1;
$template="homepage";
$category=1;
$static=TRUE;
include("/hsphere/local/home/mydomain/mydot.com/pressroom/show_news.php");
?>'\; }

if ($_GET['content'] == 2) {
echo 'Content for Page 2'; }

if ($_GET['content'] == 3) {
echo 'Content For Page 3'; }

?>

What am I doing wrong, all the other tabs work fine?


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 21 August 2006 - 05:19 AM

Why not:

if ($_GET['content'] == 1) {
    $number=1;
    $template="homepage";
    $category=1;
    $static=TRUE;
    include("/hsphere/local/home/mydomain/mydot.com/pressroom/show_news.php");
}

Legend has it that reading the manual never killed anyone.
My site

#3 mtanner

mtanner
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 August 2006 - 06:03 AM

Oh snap! Thanks AndyB! Whoo hoo.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users