/    Sign up×
Community /Pin to ProfileBookmark

Is this possible?

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

to post a comment
PHP

13 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyDec 21.2005 — 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.
Copy linkTweet thisAlerts:
@welshDec 21.2005 — also if you dont have php one solution may be iframes . would probally get messy though.
Copy linkTweet thisAlerts:
@gameguy43Dec 21.2005 — 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...
Copy linkTweet thisAlerts:
@chazzyDec 21.2005 — you can write a navigation bar, save it as a file then include it as a php include...
Copy linkTweet thisAlerts:
@DavidAPauthorDec 21.2005 — 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.
Copy linkTweet thisAlerts:
@bathurst_guyDec 21.2005 — 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.
Copy linkTweet thisAlerts:
@NewZealandDec 21.2005 — You could use a [url=http://php.net/switch]switch[/url], 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?
Copy linkTweet thisAlerts:
@DavidAPauthorDec 21.2005 — 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.
Copy linkTweet thisAlerts:
@bathurst_guyDec 21.2005 — 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.[/QUOTE]

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".
Copy linkTweet thisAlerts:
@DavidAPauthorDec 22.2005 — 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! [B]Copy[/B] these pages and put your specific database info [B][COLOR=Red]here[/COLOR][/B] and [B][COLOR=Red]here[/COLOR][/B], then [B]save[/B] this page as "[B]thispage.php[/B]" and that page as "[B]thatpage.php[/B]" and put them [B][COLOR=Red]here[/COLOR][/B] and [B][COLOR=Red]here[/COLOR][/B]. Congratulations, you have a working database. Now go and be databaseless no more."

Simple really is better, short and simple is better still.
Copy linkTweet thisAlerts:
@bathurst_guyDec 22.2005 — Have you tried the PHP and SQL tutorials from w3schools.org
Copy linkTweet thisAlerts:
@bathurst_guyDec 22.2005 — "Allright knucklehead, listen up! [B]Copy[/B] these pages and put your specific database info [B][COLOR=Red]here[/COLOR][/B] and [B][COLOR=Red]here[/COLOR][/B], then [B]save[/B] this page as "[B]thispage.php[/B]" and that page as "[B]thatpage.php[/B]" and put them [B][COLOR=Red]here[/COLOR][/B] and [B][COLOR=Red]here[/COLOR][/B]. Congratulations, you have a working database. Now go and be databaseless no more."[/QUOTE]
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.
Copy linkTweet thisAlerts:
@SpectreReturnsDec 22.2005 — 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.
×

Success!

Help @DavidAP spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...