View previous topic :: View next topic |
Author |
Message |
tvtoday
Joined: 10 Jun 2003 Posts: 6
|
Posted: Wed Jul 16, 2003 10:09 pm Post subject: php include trouble |
|
|
My site is http://www.tvtoday.co.uk/
I thought that the PHP include function could be used just like an SSI.
So I dropped the following line of code into my index.php:
<?php include("http://www.tvtoday.co.uk/notes.php") ?>
(nb there's nothing wrong with notes.php, it works fine).
And got this error message:
Warning: Failed opening 'http://www.tvtoday.co.uk/notes.php' for inclusion (include_path='') in /home/t/v/tvtoday/public_html/index.php on line 41
What have I done wrong? Do I need to CHMOD notes.php?
thanks
Nick |
|
Back to top |
|
 |
.Chris
Joined: 30 Apr 2002 Posts: 186 Location: Hawaii
|
Posted: Wed Jul 16, 2003 10:17 pm Post subject: |
|
|
Try Code: | <?php include("/home/t/v/tvtoday/public_html/notes.php") ?>
or
<?php include("notes.php") ?> |
_________________ this is my clone. |
|
Back to top |
|
 |
tvtoday
Joined: 10 Jun 2003 Posts: 6
|
Posted: Wed Jul 16, 2003 10:22 pm Post subject: |
|
|
Tried both, neither work.
Nick |
|
Back to top |
|
 |
.Chris
Joined: 30 Apr 2002 Posts: 186 Location: Hawaii
|
Posted: Wed Jul 16, 2003 11:02 pm Post subject: |
|
|
ok how about Code: | <?php include '/home/t/v/tvtoday/public_html/notes.php' ?>
or
<?php include 'notes.php' ?> | Or just ignore me and what for someone experienced to help  _________________ this is my clone. |
|
Back to top |
|
 |
tvtoday
Joined: 10 Jun 2003 Posts: 6
|
Posted: Wed Jul 16, 2003 11:52 pm Post subject: |
|
|
With a bit of tinkering I've determined that the problem is more complicated than I initially suggest.
There's nothing wrong with the php command I have used.
This is what I'm trying to do:
I want to have a 'thought-stream' category and I want to have it running down a column, separate from my other posts.
So I have excluded category 13 (the thought-stream) from the general list, and written a php file to show only category 13 - that's what notes.php.
The problem, I think, is to do with the way the mySQL database works, and the loop.
I think that the answer lies in editing variables within the notes.php file - the best I have got so far is this:
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; $cat="13"; include ("blog.header.php"); ?><!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>
<!-- // b2 loop start -->
<?php { start_b2(); ?>
<b><?php the_title(); ?></b>
<br><?php the_content("","1","") ?>
<br><i><b><?php the_date("jS F") ?>, <?php the_time("hh:mm"); ?></i>
<!-- // this is just the end of the motor - don't touch that line either -->
<?php } ?>
As you can see, I have excluded the 'while' command, etc, from the start_b2() line - the result of this is that the file produces a comma and some whitespace.
Aaaaaargh. |
|
Back to top |
|
 |
|