Write to a List// if full: move bottom line to list #2

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Lofter
Forum Newbie
Posts: 1
Joined: Sun Jul 30, 2006 8:25 pm

Write to a List// if full: move bottom line to list #2

Post by Lofter »

The title is the gist of what I'm trying to do. Write now I'm working on a media section on my website, and I've coded an upload form that allows me to easily update and create video pages, while adding the newly created page to a list file displayed on the main index for the media section. The problem hasn't happened yet, but I need help writing a code that will do the following:

-Check to see if the list file has 40 or more lines in it (already wrote this)
-If the list has 40 or more lines in it, move the last line of the list to a second list file.

I have the code working so far so it will add the uploaded content's link to the top of the main list, and if the list has 40 lines it will write the new content's link to a second list. But what I want to do is have it write to the top of the first list, and have the end of the first list move onto a second page. I was then planning on placing a link to the second page on the index, so it would look nice.

What I'm trying to do is really like what blogs do when there is already a certain number of posts on a page, they have the last post on the page move to a 2nd page to make room for the first page.

Thanks for any help, I really appreciate it ----L0fter
Post Reply