ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to reorganize a website that has a lot of texts. I would like to be able to insert the text into a database or perhaps a large text file, and when a visitor clicks on the link, the correct paragraph(s) would be automatically displayed.
is there a way to do this? or do I need to create an html page for each part? what is best to do this, asp, php, flash, or other method?
Most sites that do this use a database, mysql and php would probably be the simplest for your needs, you don't need to create a real page for each virtual page. The easiest way to do this is using a local rewrite rule in apache.
i'm not a whiz at programming, but here's what I'm thinking:
for sql database
I'd create a table for each section:
table 1=section a
1 | Title | Paragraph 1 | Paragraph 2 | etc.
2 | Title | Paragraph 1 | Paragraph 2 | etc.
3 | Title | Paragraph 1 | Paragraph 2 | etc.
4 | Title | Paragraph 1 | Paragraph 2 | etc.
5 | Title | Paragraph 1 | Paragraph 2 | etc.
table 2=section b, and so on.
so, I think if a user clicks a link to create a page for section 1, story 1 I could arrange the paragraphs via html tables.
But there are a few things I don't know how I should do, for example, all parts have a different number of paragraphs, so how can I arrange the paragraph formatting? before I used css files and <p align=justified style:text-indent=.3in class=bodytext></p> but if I put all those paragraph place holders like this:
<p align=justified style:text-indent=.3in>DATA from SQL here</p>
<p align=justified style:text-indent=.3in>DATA from SQL here</p>
<p align=justified style:text-indent=.3in>DATA from SQL here</p>
would it cause problems if there was no data for a given paragraph? or is it possible to create this dynamically also?
And how would I arrange a next/previous link dynamically? I'd like the link to be active if there is a section before or after the page the viewer is looking at.
I know this might be quite a bit i'm asking, so i'm looking into an online tutorial about how to use php and sql, but I sure would appreciate help from the guys here :-)
I'm not sure where you got the idea that it is english only. Maybe some specific databases are but MySQL certainlys isn't. Take a look at all the wikipedia sites that use MySQL: http://wikipedia.org/
You may actually want to consider using an existing cms system or wiki if you aren't keen to program something yourself.
While its true that I'm not great at creating code from scratch, I'd like to do better, only way I know is to see someone else's code and learn from them, or ask them why it works that way if I don't understand.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.