Jump to content

cssmatt

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cssmatt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. cheers, thats what i was looking for!! Now i have another problem! My search sql is playing up! For example, if i search for the word "stan", i know that this only has one occurance in the table im searching. When the search is performed, it brings back 5 results. Each of the results links to the correct entry, but it prints every row in the table in the process (hence bringing back 5 results) Is there a problem with the query im using? [code] $sql = "SELECT table1.user_name, table1.user_id FROM table1, table2 WHERE table2.description LIKE '%" .  $_POST[keywords] . "%' AND table1.user_id = table2.user_id AND table2.group_id = '2'";[/code]
  2. im currently making a search facility, and i have come across the problem of having too many results on a single page. I know the way around this is to display the results into sets of 10 or so, and provide links to "next page" or "11 - 20" etc. But im not sure exactly how i would go about this. Would the links at the bottom of each page have to link to a separate page which performed the search again, but used the SQL LIMIT function to say LIMIT 10,20 or something along those lines? Anyone know of any tutorials that cover this??
  3. Ive tried using set_time_limit() by setting it to 0, also by leaving it blank, but it doesnt seem to have an effect?! Ive also tried max_execution_time(), which also doesnt have any effect?! I notice on pp.net that it says, set_time_limit only has an effect on the script itself, and not external activites, would loading an image class as an external activity, as i notice that database queries are?!?! Could this be the problem, if so, any work arounds?!
  4. I think i am having the same problem, in that i create a thumbnail of a larger picture by calling a thumbnail generator script, by passing a path to it. And then it outputs the picture to screen. This process is looped untill all thumbs are displayed. Although only the first 9 or 10 are ever all displayed correctly. After that the odd one or two are broekn links. Would i benefit from extending the set_time_limit() or is my problem related to the server not being fast enough?? More detail here: [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=90020\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=90020[/a]
  5. Yeah if i "Show Picture" then it displays it fine. Changing the limit does help, because the broken images didnt appear in the first 10 photos. Its only over that amount that problems occur. Is there no other work around than displaying in blocks of 10? Because the full size images are only 400 x 400 photos?! And there are only 24 or so in each gallery??
  6. I am currently trying to implement a thumbnail generator to my site. I have a few photo galleries which are quite large, so i want to display all these photos as thumbnail, which can be then clicked to show the full size image. The picture path is stored in a mySQL database, and im trying to loop through this DB to retrieve all the photos for the spcific gallery, then run each ful size photo through a thumbnail generator script, to output a small version. I have this done, but the script seems tempramental to say the least! Everytime i run the script, some thumbs are display and some appear as broken links. But the pictures are different everytime, so its not like it cant find the pictures, because refreshing it display different combinations of broken img's. The thumbnail script is straight from php.net [code] <?php // File and new size //$filename = 'http://www.bradmush.co.uk/21/1.jpg'; $percent = 0.25; // Content type header('Content-type: image/jpeg'); // Get new sizes list($width, $height) = getimagesize($filename); $newwidth = $width * $percent; $newheight = $height * $percent; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // Resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb); ?> [/code] and i am using the follwoing code to loop through the pictures: [code] <?php     $sql = "SELECT picture_path FROM loc_pictures WHERE gallery_id = '$_GET[gallery]' LIMIT 25";     $result = mysql_query($sql);     echo $num = mysql_num_rows($result) . " pictures found";          $x = 1;     while ($row = mysql_fetch_array($result))     {      echo "<a href = '$row[picture_path]' rel = 'lightbox'>";      echo "<img src='thumb.php?filename=$row[picture_path]' border = '0' /></a>";      echo " ";           $x ++;     } ?> [/code] The picture path is saved in the format "../gallery/1/1.jpg" and ive also tried changing this to an absolute path, which doesn work either!! Plus, to add insult to injury sometimes i get a 403 forbidden error, which im not sure if this is related, but it isnt permanent, and seems to be remidied by refreshing my FTP?! Any help would be grand!!
  7. Im trying to protect a folder of images so that users cannot simply type in the URL and load the picture. My site has a login script so that only users who have access can view the pictures. So i want to be able to load these pics onto a webpage for viewing, but i dont want the folder accessible?! Is this possible, because ive tried quite a few chmod settings, and it seems that to view the image at all needs the Other setting to be 7 (execute). If i set it to anything else, the users cant access the folder dirst (which is what i want), but i cant view them through the webpage either!! Any suggestions?
×
×
  • 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.