Jump to content

Kolusion

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Kolusion's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. A very good suggestion! That sound like a part of the engine I am looking for, but how would I specify which directory to search, and to specify the search to be reclusive, then to include all of those files? Can it be done? I'll tried this, but it failed: foreach (glob("*.lodb") as $filename { include($filename);}
  2. I am new to PHP and wasting no time have jumped into creating my own database system. Its actually a psuedo-database, but who cares it works. I've done something some-what similar in Python but with a static single file database. What I have is directories as like: ./1/index.listing ./2/index.listing ./3/index.listing The numbers are a product... product 1, product 2, you know.. What I want to do is on the product category page, using: include('./*/index.listing'); .. where * would mean for PHP to scan all relative directories and include 'index.listing', which will result in a list being built for the product category, showing all the available products. There is probably some way to do this in MySQL, but I am already familiur with this style of database, so why waste more Saturday nights learning something I don't have to when I could be out getting drunk and partying with girls 10 years younger than me. LuLz
  3. Hey dude, haha yeah the problems resolved now. What I actually did was allow .html files to be executed as PHP from httpd.conf (Apache) Thanks anyhow!
  4. I don't have time to learn every bit of PHP.. only the things I need. Why do you say MySQL for lots of items?
  5. Just to let you know, the code above has been fragmented by this website. The untouched file is hosted here: http://www.qfpost.com/download.do?get=1fe261dc5fa32a907c8cb2b4cd7ac354
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <TITLE>X</TITLE> <META content="charset=windows-1252;text/html" http-equiv="content-type"> <STYLE type="text/css"> BODY { background-attachment:fixed; background-image:url("/bodybackground.png"); background-position:center; background-repeat:no-repeat; font-family:verdana } IMG.logo { left:50%; margin-left:-635px; margin-top:-355px; position:absolute; top:50% } SPAN.accountmenu { left:50%; margin-left:589px; margin-top:-352px; position:absolute; top:50% } SPAN.mainmenu { left:50%; margin-left:374px; margin-top:-331px; position:absolute; top:50% } A.silver { color:silver; } TABLE.main { background-color:gold; height:636px; left:50%; margin-left:-635px; margin-top:-307px; position:absolute; top:50%; width:1270px } A.legal { color:silver; left:50%; margin-left:-90px; margin-top:334px; position:absolute; top:50% } </STYLE> <DIV> <IMG alt="" class="logo" src="../../../logo.png"> <SPAN class="accountmenu"> <A class="silver" href="/login">Login</A> </SPAN> <SPAN class="mainmenu"> <A class="silver" href="/contact">Contact</A> | <A class="silver" href="/information">Information</A> | <A class="silver" href="/products">Products</A> </SPAN> <TABLE class="main"> <TR> <TD> <?php include('./1/index.html'); ?> </TD> </TR> </TABLE> <A class="legal" href="/legal">© X 2012</A> </DIV>
  7. No problem in error.log and access.log shows it didn't even try to fetch '/1/index.html'. <?php include('./1/index.html'); ?> .. is also showing up in the HTML source code via my browser. Is that normal?
  8. Here is something that enforces my original thought. <?php include('./1/index.html'); ?> When I put this code into its own .php file an run it, it works. So the code is valid. Now to the question, why won't it work inside a table?
  9. Please ignore my last two posts. Ok, where can I check PHP log files?
  10. When I paste the code outside a HTML table, it works fine.
  11. At the moment I am creating a search function for my website. The approach I have in mind is a pseudo-PHP database. To give an example: A HTML form will submit the results to a PHP file. HTML FORM - Colour: Black PHP RESULT PAGE - if ($_POST['color'] == 'Black') {readfile("./products/black/*.html");} HTML FORM - Price: <$50 PHP RESULT PAGE - if ($_POST['Price'] == '<$50') {readfile("./products/less50/*.html");} The problem here is if there is an item that is black and costs less than $50, then its going to be listed twice. There is probably some code I can write to ommit the listing of duplicate entries, but it is probably going to be messy, so I am wondering if its better to use a centralized MySQL database, rather than a pseudo-PHP database? I've never used MySQL and don't know much about it and this is my first real attempt at using PHP.
  12. Sure, The root path is: /var/www/test1.com/ The include\readfile path (the file I want being rendered into the table: /var/www/test1.com/products/1/index.html The HTML file in reference that holds the table called "main" we are talking about is: /var/www/test1.com/products/index.html
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.