Jump to content

jishosan

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Posts posted by jishosan

  1. MadTechie is right on. Honestly, you wouldn't need more than about 60M or so for at 3500 pixel image, even if PHP creates a bitmap copy during the image resampling process. 80M should be enough, and 160M is probably overkill.

     

    I take it the memory_get_usage() line never executed or showed you any additional error message?

  2. To expand on what was explained before:

     

    When using $this-> within a class definition for OOP, you are telling the system to reference the specific instance of a class rather than the actual function itself. For instance:

     

    <?php
    
    class Bar { 
       var $text;
    
       function HelloWorld() {
              echo $this->text;
        }
    }
    
    $Foo = new Bar;
    $Foo->text = "Hello, World! <br>";
    $Foo2 = new Bar;
    $Foo2->text = "Goodbye, World! <br>";
    $Foo->HelloWorld();
    $Foo2->HelloWorld();
    ?>
    

     

    In the code above, we created two instances of the same class. When we called the HelloWorld() function for each class, the $this->text keyword replaced "$this" with the corresponding class name ($Foo and $Foo2).

  3. akitchin is exactly right. The system does not retain the 'search' variable when you click on the second link. It is basically reloading the query, but with an empty search string, which means the entire query is basically "order by name". You need to modify your order links to retain the search= string by appending the order string to it. You could use things like Session variables to get around this limitation, but it seems like the simple fix that was mentioned will cover it.

     

    Because you are using echo commands for you html, you should be able to just put it like this:

     

    if (mysql_num_rows($result)>0) { 
    echo "<div id=sortactions>". 
                 "Order results by: ". 
    		"<a href='search.php?search={$searchTitle}&order=name'>Name / </a>". 
                 "<a href='search.php?search={$searchTitle}&order=price'>Price</a></div>";
    

  4. Perhaps a strange question, but your comments note that you want a maximum thumbnail size of 100x100. However, your code seems to set the longest side to 140px. Was that just an intentional feature change? Looking at the information you posted, you have PHP memory_limit set to 40M, which should be plenty. Are the images coming from two different sources? Can you add some echo statements to echo your assigned values as the script runs? If one of your values resolves to 0, you might be experiencing a divide by zero error.

×
×
  • 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.