Including titles from other pages

Keegan's picture

They have: 300 posts

Joined: Aug 2001

Lately I have been working extensively with included files. But I am stuck on something.

As there are various news scripts out there (cgi,php, asp) I want to do it with just HTML

It isnt the easiest thing to explain but I will try.

There would be an index page.
In the same folder would be the news .shtml listed like this
index.shtml
1.shtml
2.shtml
3.shtml
4-12.shtml...

I want the index page to pull the titles of the other documents in the same directory.

If I can get this to work each month would have its own directory.

I have seen php scripts pull a redirector for a 404 page (putting the not found url into the title of the page as well as in the body of the page allowing formatting.

../professionals/index.shtml, was not found < That was one part of the script.

Then the body of the page would be echo the redirector and allow formatting.

(An example of this is to type kilclinefuneralhome.com/anything.htm)

It will spit out the example.

After seeing that php script it gave me the idea to build a site around the use of including titles from other pages. I am lost as to what to do to make it happen as I am coding deficient. (Mostly a graphics guy)

KJ

[edit]Forgot to add this[/edit]

The outcome would be to have the index.shtml in one directory pull the titles of the other pages in that directory. I suppose with some ./ .// I could pull in other titles as well. I also want to limit the amount to lets say 5 or so so only the first 5 would be pulled. I am looking for peices of cgi scripts that might give me this affect but some direction would really help on just using html syntax.

Keegan's picture

They have: 300 posts

Joined: Aug 2001

Sorry Keegan, I just dont know what to tell you, you should have listened that day in class when they were teaching how to write and spell effectively, then maybe someone would answer your post.

WOW ZING PONG! ZOWIE! KABLAM!

Peter J. Boettcher's picture

They have: 812 posts

Joined: Feb 2000

Keegan,

Mind if I join in the discussion? Smiling

Obviously you can't do this with HTML (it's client side, and the stuff you need to do is on the server), you will need some sort of processing on the server. Probably the most efficient way would be to store the title and content of the news in a database and build your links that way. I can't really help you with CGI/Perl since I'm mostly into ASP, maybe check out cgi-resources.com , they might have something you can use?

uhm, SHAZAM!

PJ | Are we there yet?
pjboettcher.com

Keegan's picture

They have: 300 posts

Joined: Aug 2001

I think you are right, I know that the includes are server side and all that is spit out is the html result of the inclusion.

What got me thinking that a php script would do this is how it functions with an error document apache handler.

Plus how it pulls out the redirector.

I hate to be stubborn (Probally due to my ignorance to programming in general, but I think html can do it.

I will try a more hard core programming forum and report back about this thread. When I get specifics people that arent yet into server side scripting will want this information to demystify the limitations of client side scripting with html only. Then possibly (Which I did not do) move onto a server side scripting language.

I tend to believe what you say though even after your shazam made me say all of that stubbornly, yes two b's Keegan, or is it? Dang! I cant even code in the alphabet!

I need ABC's for dummies.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Quote: Originally posted by Keegan2
I want the index page to pull the titles of the other documents in the same directory.

If I can get this to work each month would have its own directory.

You want a PHP script to dynamically list the titles of documents in a set of directories? This can be done (not too hard), but it will put a load on your server. If your going to be using this to index your news, I would recommend dumping your current news system, and adapt a new PHP & mySQL system. Doing so would make indexing faster, and also allow search capabilities for the content.

Mark Hensler
If there is no answer on Google, then there is no question.

Keegan's picture

They have: 300 posts

Joined: Aug 2001

I agree, problem is I can't

The projects I have on my table require me to be in photoshop constantly. In 4 days I hope to be done with Kilcline, Eden, And a Brvnent

They started 4 days ago, all have layouts completed (About 8 different ones 5 for Brvnent alone.

I want to devote my time to MySQL but I wont have the time for at least a week.

The resources on the server I am not worried about. The server is a dedicated for a hosting company is just for billing, and the main site. It will handle it.

I have seen you code so I know when you say it, you mean it. I would not want to take up your time unless it is actally that easy.

Also thank you for confirmiing that PHP could indeed do it, ya kno why? Because Php has that little extra that will make me not look at cgi again as the language I want to learn. Php is very cool, plus I bought some books, damn as books are sitting getting dusty, someone want to buy em? hehe.

Thanks again.

K

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Quote: Originally posted by Keegan2
I hate to be stubborn (Probally due to my ignorance to programming in general, but I think html can do it.

Keegan, this is why I moved this post to the server side scripting forum. HTML cannot "read" anything other than what you tell it. In order to read titles on other pages, you need a server side scripting language (any one will do: ASP, PHP, Perl, Java, Cold Fusion, et cetera) to read the files in the directories and pull out the information you need.

HTML is not like XML or SGML -- it is a fairly static markup language that is predominantly for display. Yes, it can include images and embed sounds and such, but only when told to. So you could include titles as long as you were willing to add the titles yourself, which I gather is not really what you are wanting.

So no matter how much faith you have in HTML, it cannot read a directory and cannot pull information from a file or files in said directory.

Smiling Suzanne

Keegan's picture

They have: 300 posts

Joined: Aug 2001

That is where it beings to be a mystery.

That is why I am looking into PHP.

Missing Document or a moved document. ERROR 404: <?echo"$REDIRECT_URL";?> was not found.

File:
"
<?echo"$REDIRECT_URL";?>
" could not be located on this server. 

Possible
Solutions:

Back
to Main Page

Site Administrator
View the site-map
You can also search

Or click
back on your browser to return

<?echo"$REDIRECT_URL this is what has started this.

I think Mark is right though, using MySQL to insert the titles of the documents into a table, then pulling them with an actual PHP page. Instead os .shtml, .php

This is interesting because it would allow a customer that can upload page (Templates) and then another page would report to the main area page. Seems more complicated than is needed eh.

I think I better look into an already written news script, mabye learning how to modify it so I think I agree Suzanne, yes I do.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

<?echo"$REDIRECT_URL this is what has started this.

That's a line of PHP requesting information from the server. In SSI, it would be similar -- just a line in the middle of the HTML.

But the page would be called .shtml and parsed at the server level before returned to the browser as pure HTML.

I can see the confusion!

If you are looking for news scripts, there are a few threads on that topic (probably in this forum). NewsPro, Greymatter, Blogger, are all differen types (perl, perl, hosted ASP respectively) and there are more still out there.

Smiling Suzanne

Keegan's picture

They have: 300 posts

Joined: Aug 2001

I have used newspro, installed it countless times and I just hate cgi! its evil! lol

php has a nice feel to it, which is motivating me to spend some time learning it.

I am looking at hotscripts right now to find something I can modify, learn something from etc.

K

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Quote: Originally posted by Keegan2
I am looking at hotscripts right now to find something I can modify, learn something from etc.

Good move. You might also check out http://resourceindex.com.

Mark Hensler
If there is no answer on Google, then there is no question.

Keegan's picture

They have: 300 posts

Joined: Aug 2001

Well I am at in again, I am installing Apache, PHP, MySQL, MySQL Front, PHPMyAdmin, Perl, and some special modules. I am going to force learn PHP and MySQL if I have to empty the local starbucks

Thanks Mark, I am going to pull apart my favorite script. Asymlate its functions and RULE THE WORLD!!!! Mwha mwha mhwaaaaa

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.