473,749 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Gallery

Hi,

I am a PHP Developer.can any one help me on image upload and
display of that image.what i want is uploading an image to a
directory ,displaying of that image as a thumbnail.when i click on
that image the image should be diplayed in another page.

I wrote code for image uploading and as well as display code.but i
couldn't write image resizing when click on that.:(

can anyone come up with code for this ,
asap.Otherwise suggest me a way how to get this.

Thanks.

Oct 3 '05 #1
3 2178
Hi!
<?php
/*
* add.php
* Plik, za pomoca którego mozemy dodac obrazki do galerii
* @author Filip Fipaj Konarowski <fi*******@gmai l.com>
* @todo Sprawdzenie, czy plik jest obrazkiem; opisy + MySQL
*/
?>
<form enctype="multip art/form-data" action="add.php " method="post">
<input type="file" name="my_file">
<input type="submit" name="sent" value="Dodaj obrazek!">
</form>
<?php
if (isset ($_POST['sent'])) {
/*
* Sprawdzamy, czy formularz zostal wyslany
*/
if (is_uploaded_fi le ($_FILES['my_file']['tmp_name'])) {
/*
* Sprawdzamy, czy plik byl juz uploadowany
*/
$strUploadDir = 'img/' . $_FILES['my_file']['name'];
/*
* Folder, do którego beda zgrywane pliki
*/
if (move_uploaded_ file ($_FILES['my_file']['tmp_name'] ,
$strUploadDir)) {
echo 'Udalo sie :)';
/*
* Upload pliku
*/
include ('img.inc.php') ;
resizeImage($st rUploadDir, 100, 100, 'little_img/'.
$_FILES['my_file']['name']);
/*
* Tworzymy miniature
*/
}
else {
echo 'Nie udalo sie :)';
/*
* Wyswietlenie komunikatu bledu
*/
}
}
else {
echo 'Nie udalo sie :)';
/*
* Wyswietlenie komunikatu bledu
*/
}
}
?>
Delete comments; class to resize image you can find here:
http://forum.php.pl/index.php?showtopic=36150

And learn polish :)

Oct 3 '05 #2
Hi fipaj,

Thanks for u r code.
And learn polish :)

Is there any thing wrong in my query? :( .If it is
,i am sorry.

Oct 4 '05 #3
No, of course I'm joking :)

Comments are in Polish, I'm from Poland i I code in this langauge only
;)

Oct 4 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3929
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in displaying them on the delete page. you can see it in action at www.4am.com.au/gallery/upload.php...
10
2279
by: Captain Ranger McCoy | last post by:
Hello! Suppose I have ten servers at ten ips: x.x.x.1 x.x.x.2 x.x.x.3 x.x.x.4 and so on Each server hosts 100+ photo galleries, all under a single domain name,
54
7238
by: Max Quordlepleen | last post by:
Apologies for the crossposting, I wasn't sure which of these groups to ask this in. I have been lurking in these groups for a week or so, trying to glean what I need to design a simple, clean set of pages that get the w3c tick for XHTML 1.0 Strict, and CSS2. So far, I have succeeded, thanks to the great information in these groups. Now, however, I'm having trouble. A few days ago, I read a thread that dealt with this issue of...
7
3271
by: Eric Lindsay | last post by:
I would like to do a photo gallery with a liquid layout. I wanted to center a caption below each photo (or above each photo). I can do that easily with tables, but then I don't have a liquid layout. Besides, I wanted to try to do it with CSS. I can do centered captions with text-align. This works provided the element containing each photo is floated left. I have found several examples of how to do this. However I didn't want the...
1
2228
by: Throw | last post by:
G'day everyone I'm looking for a simple photo gallery script in PHP (or Perl), but not too simple. I have tried several photo gallery scripts in either language and I have found that they are either too complex or too simple for my purpose. Most photo gallery scripts are intended primarily for sharing new photos continuously and allowing visitors to comment on them. I want something more static, which allows more text content.
11
2778
by: ste | last post by:
Hi there, Further to my recent posts where I've received excellent help from Rik and Jerry, I've ended up with an image gallery on my website that displays images in a table, 3 images per row. This works great and opens all images in the database when I open the url mywebsite/gallery.php, or I can choose certain images (by category) by going to url's like mywebsite/gallery.php?category=landscape Although the above worked perfectly...
1
2316
by: gescom | last post by:
My goal is to create essentially two galleries on a single page, in which the first gallery determines what the second gallery displays. For instance, the first gallery refers to the contents of the main image folder. The second gallery would be a folder inside the main image folder. Depending on which image is displayed, the first gallery's image would trigger the second gallery's contents. I suppose this is sort of a hierarchal gallery...
11
2094
by: shror | last post by:
hi every body I need help please i have designed an image gallery of about 20 pictures and they are shown in thumb nail views and for viewing the largeer version of the images i have added a radio button and a push button, so that the user choose the picture using the radio button and click on the push button to open the larger version picture in another window, but my problem is that i know how to pass the selection to the second page...
2
2315
anfetienne
by: anfetienne | last post by:
hi, i've got a flash gallery which i've paid for. Im using swf object to import vars to the gallery....the var being imported is a html address to specify the location of files and folders. The problem is that the gallery detects the thumbnails and loads the 1st image but once i click on another image it wont load, i don't know why it it doing this and as it loads the thumbnails which are in the same location it shouldn't have a problem...
0
2306
nomad
by: nomad | last post by:
Hello Everyone. I founded an Flash and xml photo gallery. It works but I took it to another step What I want is to have six different galleries in one Flash file. I figure out how to do that but when I click on the the galleries I can see the pervious gallery files. The gallery works like this: When you open the gallery there are links on top of the page where you can go to other gallery; with gallery one which has small thumbnails on...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9566
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8256
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6800
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.