Closed Thread Icon

Preserved Topic: Simple PHP question Pages that link to <a href="https://ozoneasylum.com/backlink?for=21035" title="Pages that link to Preserved Topic: Simple PHP question" rel="nofollow" >Preserved Topic: Simple PHP question\

 
Author Thread
kretsminky
Maniac (V) Inmate

From: A little lower... lower... ahhhhhh, thats the spot
Insane since: Jun 2000

posted posted 07-10-2002 01:51

I want to do a simple include with php to create an index of titles for a poetry collection I am working on.
http://krets.net/verbose

That's the page. What I want to be able to do is create the links to all the titles in a text file and just update the text file when I add a new poem instead of having to update each page.

I know next to nothing of PHP and I've looked around for tuts on the subject but I've had little luck.

Can anyone help me out?

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-10-2002 04:42

You'd be better off just creating that "nav" part on the left, and including it on all pages. Using a flat text file would require you to parse it and format it on the fly. Create your nav section in a seperate .php file, and in place of the nav on each page, put:

<?php
include("path/to/nav/file.php");
?>

Keep in mind that it's the system path, not the URL.

Does this make sense?


kretsminky
Maniac (V) Inmate

From: A little lower... lower... ahhhhhh, thats the spot
Insane since: Jun 2000

posted posted 07-10-2002 04:46

Yep, that's exactly what I needed.

Thanks man.

kretsminky
Maniac (V) Inmate

From: A little lower... lower... ahhhhhh, thats the spot
Insane since: Jun 2000

posted posted 07-10-2002 05:21

Do I need to chmod any of the files?

It's not working...
http://krets.net/verbose/test.html

Piper
Paranoid (IV) Inmate

From: California
Insane since: Jun 2000

posted posted 07-10-2002 05:40

Hi kretsminky,

You need to rename the file with a .php file extension. You can also configure Apache to parse html files but that adds a lot of overhead to the server if your site is very busy.

[edit]It looks like you beat me too it. I tried test.php and got an error message though. Your path should be more like /home/kretsne/public_html/verbose/nav.php instead of /public_html/verbose/nav.php.[/edit]

Regards,
Charlie

[This message has been edited by Piper (edited 07-10-2002).]

kretsminky
Maniac (V) Inmate

From: A little lower... lower... ahhhhhh, thats the spot
Insane since: Jun 2000

posted posted 07-10-2002 05:42

Tried that...
http://krets.net/test.php

The nav to be included is:
http://krets.net/nav.php



[This message has been edited by kretsminky (edited 07-10-2002).]

kretsminky
Maniac (V) Inmate

From: A little lower... lower... ahhhhhh, thats the spot
Insane since: Jun 2000

posted posted 07-10-2002 05:49

Woo hoo!

It works.

Thanks piper and pugz.

« BackwardsOnwards »

Show Forum Drop Down Menu