Jump to content

Kolusion

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Posts posted by Kolusion

  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. <!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>

  4. 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.

  5. That link is 404.

     

    I tried:

            <TABLE class="main">
                    <TR>
                            <TD>
                                    <?php
                                            include('./1/index.html');
                                    ?>
                            </TD>
                    </TR>
            </TABLE>

    .. but it didn't work.

  6. I am wanting HTML to render within a table and sourcing the data from another file. In an attempt to do this, I tried:

    <TABLE class="main">
                    <TR>
                            <TD>
                                    <?php
                                            readfile('./1/index.html');
                                    ?>
                            </TD>
                    </TR>
            </TABLE>

     

    This does not work and I am wondering if anyone knows how it can be done - or even if it can be done?

  7. I am trying to make PHP output a file in html and using the following code.

    <?php
                                            readfile("./1/index.html"); 
                                    ?>

     

    ... but it isn't working. How would I get PHP to output a file as 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.