...

View Full Version : Display different bodies of text into a table?



JoeBobJr
01-11-2012, 01:59 AM
Does anyone know of a way to use php to pull text from a file and put it into a certain table on a web page?

For example say I have 6 links on one page of a website. I have one table with the 6 links and below that I have another table that is empty.

Each time I click one of the links I want to display a certain body of text in the bottom table. I can't think of any other way to do this besides pulling from text files. I don't know if this is even possible but I'm trying to keep my navigation and number of pages on my site down to a minimum.

Does anyone have any suggestions on how this could be done or a better way?

mlseim
01-11-2012, 05:04 AM
You need to think about how to organize it.

You can have 1 text file that contains all the text, or separate text files for each body.
You can use MySQL for a database,
You can use a plain text (.txt) file for a database,
You can use Google Docs Spreadsheet for a database.

There are thoughts to ponder ... if the user views a certain body and comes back
to your site in 2 days, will they be on the same spot (using cookies)?

Can the page refresh when they press the link, or should it use AJAX and update
seamlessly, without a page refresh?

How will you update the bodies of text?
And do those text bodies need to contain HTML (like rich text?).

All of those things result in different answers.

JoeBobJr
01-11-2012, 05:27 AM
You need to think about how to organize it.

You can have 1 text file that contains all the text, or separate text files for each body.
You can use MySQL for a database,
You can use a plain text (.txt) file for a database,
You can use Google Docs Spreadsheet for a database.

There are thoughts to ponder ... if the user views a certain body and comes back
to your site in 2 days, will they be on the same spot (using cookies)?

Can the page refresh when they press the link, or should it use AJAX and update
seamlessly, without a page refresh?

How will you update the bodies of text?
And do those text bodies need to contain HTML (like rich text?).

All of those things result in different answers.

What I would like is one page that does everything. I'd like it to refresh within the page not actually the whole website.

I'd like to have some links displayed to the user on a page. Each time a user clicks one of the links it displays the text I have set for that link. It will just be plain text. But when the user clicks another link I don't want the content to stay I want it to disappear and the next body of text be displayed.

I was thinking maybe something like include files that are pulled when needed to display the content. Maybe set up variables in the code like $localservice = "I do computer repairs to desktops and laptops. I also do network installations, etc." for each thing I want to be displayed.

So when the person clicks Local Services link it tells them what services I offer. I'll have a bunch of different things like that set up. I used to have it set up like this page here.

http://www.apexcomputergroup.com/services.php

If you click a link it opens another page with the information. I'm currently transferring all my stuff from html to php-nuke but not 100% positive on which CMS portal I will use. I learned to make a module that allows me to display something on a page. I was hoping not to create a new module for every page I need displayed seems like there has to be an easier way to just display the contents on the same page but without displaying it all at once and cluttering the page.

If all that makes any sense?

JoeBobJr
01-13-2012, 02:30 AM
I just decided to create a module for each link and be done with it. If anyone were to come up with a solution that would work to display different bodies of text with the click of a button or a link would be cool to know.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum