Click to See Complete Forum and Search --> : Is this possible?


DavidAP
12-20-2005, 09:10 PM
I have a Website that has a main directory and several directories under it. Each directory or sub-directory has about 34 pages.

This is a lot of pages. I would like to have just one page or template and when a link is clicked the contents of the main column will change.

I can't use hidden layers, as this would probably just end up being a mess. Basically what I would like is to be able to import in a new text file into the main column each time a new link is clicked. The page stays the same, just the content changes whenever a link in the left column is clicked. Each link would call in a specific text file to be displayed in the main column.

Well, what do you think? Is this possible?

Thanks

bathurst_guy
12-20-2005, 09:23 PM
Yes this is definately possible. It will take some setting up though. I'm guessing that you have PHP installed on your server since you posted your question in this forum, so it will work fine.
Some questions. Will the content of the pages change frequently, or will you be required to add pages in the future? And do you also have a MySQL database on your server? This can be achieved without a database and you can just use includes for each page, but it would be more organised and much easier to update if you have this in a database.

welsh
12-20-2005, 09:30 PM
also if you dont have php one solution may be iframes . would probally get messy though.

gameguy43
12-20-2005, 11:30 PM
yeah, as im reading this its looking to me like youre asking for frames. look up a tutorial, i recommend htmlgoodies.com, though theyre kinda outdated nowadays...

chazzy
12-20-2005, 11:58 PM
you can write a navigation bar, save it as a file then include it as a php include...

DavidAP
12-21-2005, 12:49 AM
MY server does have MySQL and PHP. I don't know squat about databases or writing php code. I've read a few tutorials on databases but I haven't found one that's useful for what I want to do.

All my web pages have .shtml extensions since I'm worshiping at the alter of SSI's. My pages have three lines, 1st line SSI calls in the header, navbar, left column (menu), right column (advertisers, etc.), the 2nd line SSI calls in the main content (changes frequently) and the final line SSI calls in the footer info.

The header, navbar, left column menu, right column and footer could be hard coded onto a single page and the content in the main column fluid. Visitors are presented with twenty - thirty links and each link is connected to a specific SSI text file. When a link is clicked - instead of a whole new page loading, only the text file located within a certain <DIV> in the main column would change.

I read this last night http://www.alistapart.com/articles/phpcms/ and it's close to what I'm needing, but I thought it lacked some important details like how to make the link that would change the file. I understand <a href= and if the link doesn't start out that way then you've lost me.

bathurst_guy
12-21-2005, 12:58 AM
well you can continue to use SSI for what you want. Although a whole new page would be loaded, but the nav etc would remain in the same spot so it would appear as though only the div changed.

NewZealand
12-21-2005, 01:16 AM
You could use a switch (http://php.net/switch), Else i think a database approach would be a good idea for that many pages.


But what is wrong with the way you are doing it now with ssi includes?
It is basically the same as a php include.
As asked before, who add's the pages? you or other people?

DavidAP
12-21-2005, 02:14 AM
Right now, I'm adding all the pages and the content.

I get the content from visitors to my site who fills out a form that I have. The form emails the results to me and I copy and paste it into a notepad file and save it on my server. The information is shown for 30 days or so and then I delete it (if I remember).

No doubt, this screams for a database. It could be set up so that the information entered by visitors would go directly into the database and could be called via a link and deleted after so many days. Everyone would be happy except for my wife who would have to get a second job to pay someone to write a code to make all this happen.

Database... ugh.

bathurst_guy
12-21-2005, 02:20 AM
Everyone would be happy except for my wife who would have to get a second job to pay someone to write a code to make all this happen.

Do you have a link to the site so I can have a look and can you tell me how many hits you get per week/month?
If you don't need it in a hurry I have no problem in helping you make it. All I would ask is that if I could have a link to my site on each page at the bottom, something like "Database created by Simply Design Studio".

DavidAP
12-21-2005, 08:04 PM
Thanks for the offer bathurst_guy, but I'm going to continue working on it to see if I can figure it out.

Most of the tutorials I've read have been too confusing. They get off message a lot by discussing all the different database types and possible interface methods.

What "We the people" really need is a tutorial that starts out like this...

"This tutorial is for people who want to create a database using MySQL, PHPmyAdmin and PHP. Everyone else can go suck eggs. I will not mention or discuss any other types of databases or interfaces. I will tell you how I do it and if you do exactly as I, then you'll have a workable and useable database also."

In fact, it needn't be a tutorial at all but rather a "do as I do" instruction sheet...

"Allright knucklehead, listen up! Copy these pages and put your specific database info here and here, then save this page as "thispage.php" and that page as "thatpage.php" and put them here and here. Congratulations, you have a working database. Now go and be databaseless no more."

Simple really is better, short and simple is better still.

bathurst_guy
12-22-2005, 12:12 AM
Have you tried the PHP and SQL tutorials from w3schools.org

bathurst_guy
12-22-2005, 12:16 AM
"Allright knucklehead, listen up! Copy these pages and put your specific database info here and here, then save this page as "thispage.php" and that page as "thatpage.php" and put them here and here. Congratulations, you have a working database. Now go and be databaseless no more."
I do have something like this, for a CMS, but the only problem is everyone has different requirements and therefore customisation is needed. So there is no real across the board database structure.

SpectreReturns
12-22-2005, 03:23 AM
Plus if you're going to go through all the trouble of setting it up, you may as well learn it at the same time.