Web Analytics Made Easy -
StatCounter Making a simple list with a pseudo-database - CodingForum


No announcement yet.

Making a simple list with a pseudo-database

  • Filter
  • Time
  • Show
Clear All
new posts

  • Making a simple list with a pseudo-database

    I am developing a website. I need to create a list for the products I sell.
    I will be using pseudo-database and it will work like this.


    index.html is where the code is executed from.
    The numbers are my internal product codes, which I will use as directory names for each product.
    index.listing are HTML files containing markup which will have a layout of a thumbnail of the product and some text giving a description of what it is. - similar to eBay's search list result layout.

    What I want the code to do is reclusivly include() all of the 'index.listing' files. The result will create a list of products.

    I am sure there are other ways to achieve what I want, but I want to do it this way.
    The benefit of doing it this way is that the website will be highly modular. Once a sale has been made I can simply get php to move the folder of the sold product to a directory outside the websites www, via means such as "mv .../77 /.../sold", and won't have to play around (and learn from scratch) a real database system, such as MySQL.
    I am open for opinions.

    I am new to PHP and don't know much about "functions and elements".

    I tried the following code, but it didn't work:
    Does anyone know how can be done?
    Last edited by Kolusion; Aug 21, 2011, 07:51 AM.

  • #2
    PHP Code:
    $files glob'./*/index.listing' );

    foreach ( 
    $files as $file )



    • #3
      OMG dude! THANK YOU SO MUCH!

      I have spent the last 6 hours trying to figure this out. Your help really has been appreciated man!


      • #4
        Never mind, there was nothing wrong with the code. It was another problem. The code works. Thanks again!
        Last edited by Kolusion; Aug 22, 2011, 02:12 PM.