Please report all spam threads, posts and suspicious members. We receive spam notifications and will take immediate action!
Results 1 to 7 of 7

Thread: PHP help




  1. #1
    Join Date
    Apr 2002
    Posts
    4

    Default

    Hello, i'm working on a site soon to be opened, deviantmods.com. The site is database driven, but i cannot figure out how to make it so that it creates seperate pages. Tweaktown's reviews and articles are a perfect example. Could anyone help me out here please?

  2. #2
    Join Date
    Nov 2001
    Posts
    674

    Default

    I think you're going to have to be a lot more specific...

  3. #3

    Default

    Hey,
    Well I actually developed the entire tweaktown site, so I guess im the one that should be answering your questions hehe. :)

    OK, firstly you need a table for the articles details. it should contain a unique identifier, title, author id (linked to author table), date added, topic, etc, etc, etc.

    THEN you need an article pages table with id, title, parent article id and content fields. When you then display an article, you query the article pages table to get the page. so for the first page its

    SELECT title, content
    FROM articlePages
    WHERE parentArticle = xxx

    then to link to another page you would use a query like this to determine if there are other pages in the article

    SELECT pageID
    FROM articlePages
    WHERE parentArticle = xxx AND pageId > currentPage

    Hope that helps...
    http://www.contentconcepts.com: Get ConMan and run your own site!
    http://www.devarticles.com/ebooks.php: Free programming eBooks.

  4. #4
    Join Date
    Apr 2002
    Posts
    4

    Default

    yea, i've got the tables set up with the id, author, date, and all that good stuff. Now....the whole submitted article has an id, does the author need a seperate id to go along with it?

    ok, for a very specific example, here's one of TT's reviews:
    http://www.tweaktown.com/document.ph...review&dId=141
    alright, on the first page, he's got the into and specs, and then it cuts off and links to the second page, it has its own minititle type thing, and continues until the author told it to make a seperate page. Now, none of the pages are the exact same in length, so i'm wondering, how to you tell it to make a new page and then link to it?

    hope that helps to clarify it up

    thnx for your help devarticles....i'll be talking with my real programmer bout it

  5. #5
    Join Date
    Apr 2002
    Posts
    4

    Default

    well...good news! i got em working, thanks alot!!!!

    but now i've encountered anothe problem:
    because it sends all the data to the url address bar, it only allows a certain length of text. Well...when printed on the screen, it is NOT long. its very short, maybe 2 paragraphs max.

    how do i get around this?

  6. #6
    Join Date
    Nov 2001
    Posts
    8

    Default

    why not just use POST instead of GET?
    $title=$HTTP_POST_VARS['title'];

    GET has a lower character limit than POST [forget, but i think GET is limited to 80 chars]


    also, you should probably strip slashes..

    $title=stripslashes($title);

    then:
    INSERT INTO table (title,news) VALUES('$title','$news')


    easy! ;)

  7. #7
    Join Date
    Apr 2002
    Posts
    4

    Default

    hehe...i already got it done, thanks. devArticles helped alot :)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •