SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2009
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    populate pages automatically?

    How would I populate pages automatically on a site? I can't seem to find any tutorials or information on this.

    Lets say I have: directory > categories > subcategories

    How does the link "<a href.....> from the top directory get populated from the database to show the page and links. Then we have subsequent categories and subcategories?

  2. #2
    SitePoint Zealot busylinks1's Avatar
    Join Date
    Nov 2008
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you write it in some ore details:
    Because we can't understand what you want to ask....

    Are you want to develop a directory script or some thing else?
    If you want to built a link directory then why not you use a open source and then customize it?...

    Or you looking for the script like aboutus dot org , where if you search for a site then it creates a new page if it is not in its DB?....

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2009
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm. Lets takes this link for instance.

    http://www.sitepoint.com/forums/show...35#post4145235

    ?p= --- where does this come from?
    #post --- same thing
    4145235 ---same thing

    If I come to the forum index here, the list is generated from the database and ordered by date right? All the links are inputted automatically as html somehow. A loop must be generating the pages and forming the links. I'm looking for some example code of how this works I guess, as I really don't understand it.

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2007
    Location
    inside the modem
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    im not a php guru . . . but all its doing is calling it from MySQL so you have to write the code for it in php and then call it in your html file . . . i am just starting to crack the cusp of php, as i have taught myself html and now starting to hack at the php pages. so i am not sure how accurate my answer is

  5. #5
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    In a word, manually.

    There isn't any automatic function that you can pass your schema to and it will create the relevant links for your application I'm afraid.

    You can create a template for a link, then populate it with data which would create links for you though...

    It's all about the planning.

    You may want to look at how CodeIgniter creates URLs - it provides a nice way to do it on a generic level.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  6. #6
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to have a logic database first, which stores the value of directories, categories and subcat...

    Then you will want to take advantage of using $_GET, getting the URI to prepare the query

    Then you might need some mySQL techniques to get the right values among hundreds(maybe thousands) of generic values in database.


Bookmarks

Posting Permissions

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