Jump to content



  • Please log in to reply
2 replies to this topic

#1 han003

  • Members
  • PipPip
  • Member
  • 10 posts

Posted 22 January 2013 - 12:02 AM


After I've gotten an image from my database I'd like to make it small like a thumbnail, say 200x100, instead of 1920x1080.
And after I've resized it I'd like to put it inside an <img>, this is like a gallery, with several rows of pictures. Any who can help?

#2 Psycho

  • Moderators
  • Move along, nothing to see here
  • 11,846 posts
  • LocationCanada

Posted 22 January 2013 - 12:23 AM

This forum is for people to get help with code they have written. Are you looking for someone to do this for you? If so, we can move this to the freelance forum.

If you are wanting to do this yourself, then we are willing to help. But, you have to at least make an effort. There are plenty of tutorials out there on this subject. And, there are plenty of posts on this forum where the same question/problem has been raised. In fact, there was one today! Have you read a tutorial or other forum post and having a problem understanding part of it?

What have you done already?
The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net

#3 han003

  • Members
  • PipPip
  • Member
  • 10 posts

Posted 22 January 2013 - 01:20 AM

THere's my code
I get an image from a folder but some of them are big, like over 1mb, so id like to make just thumbnails and show the thumbnails in the <img> tag, but if you're not willing to help then by all mean put this in the other forum
thank you :)

  $counter = 0;
  echo '<table><tr>';
  foreach(glob("../Pics/Wallpapers/*.*") as $filename){

    if ( $counter%5 == 0){
	 echo '</tr><tr><td>';
    } else{
	 echo '<td>';
    echo '<div id="thumbs"><div id="image">';
    echo '<a href="'. $filename .'"><img src="'. $filename .'" height="180" width="320" /></a></div>';
    echo '<div id="text"><span>'. filesize($filename) .'</span></div></div>';
    echo '</td>';

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users