PDA

View Full Version : Creating a page where older text is automatically moved to the next page



tasteslikebert
Apr 22nd, 2010, 09:45 PM
Hi,

I'm trying to create a page where when the content in a div box gets it to a certain height, it will automatically move onto the next page; like in a news feed or blog, when the texts reaches the bottom of the page, anything new added to the top pushes the older text to page 2. I hope that makes sense! I have no idea how to do it!

mbaker
Apr 23rd, 2010, 01:56 AM
The simplest solution that I can think of is to use blogging software, such as WordPress.

Next simplest would be to use a pre-processor such as PPWizard. Next option would be to implement a system in PHP.

Using either PPWizard or PHP you could effectively do it with one file.

Place all of your entries in order. To output a page take the x (such as 10) most recent entries and output them. For page 2 take then next x (ie 10) most recent entries and output those, etc.

In the case of PPWizard you would recreate all of the pages after each addition. In the case of PHP the pages would be created on demand. Page 2 etc, by use of queries, such as index.php?page=2

rnd me
Apr 23rd, 2010, 02:15 AM
it would be FAR simpler to hide the content that would go to another page.
you could then reveal the content when the user got to the bottom, clicked a link, etc.

this would also make loading the "2nd page" instant.

tasteslikebert
Apr 23rd, 2010, 06:21 AM
it would be FAR simpler to hide the content that would go to another page.
you could then reveal the content when the user got to the bottom, clicked a link, etc.

this would also make loading the "2nd page" instant.

The thing is that I'm working with a site that is a set size, with this, the content that was hidden would get too long for the page when revealed, although this idea does make a lot of sense.

I think I'll try the PHP option, I don't know how to use PHP yet though, only HTML and CSS so far, do I need to know anything else before learning PHP?

mbaker
Apr 23rd, 2010, 09:49 AM
I think I'll try the PHP option, I don't know how to use PHP yet though, only HTML and CSS so far, do I need to know anything else before learning PHP?

If it is just you entering data into your page, then you'll do fine with your existing knowledge. [All you need to know to start learning PHP is some HTML and if you want to style your page you also need to know some CSS.]

In principal a PHP file looks like an HTML file with additional sections used to decide what to output. These additional sections are in "tags" that look like: <?php ?>

[Some PHP files are all PHP and no HTML - starting with <?php and ending with ?>]