Forum Sig Upload script Help!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ryan
Forum Newbie
Posts: 5
Joined: Sun Jan 25, 2004 9:07 am

Forum Sig Upload script Help!!!

Post by ryan »

Basicly i want to do this:

- Upload gif,jpg only
- Max file size 20k
- Max image dimensions 400 x 75 pixels (width x height)
- Allow each IP only one upload per day
- Display link to file for leaching after uploaded
- Error message if file size is greater than 20k and/or image dimesions greater than 400x75

I've tryed the tutorial at phpphreaks but i cant seem to get it working

Any help much appreciated
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

well ryan... you have many issues there!.

1- upload stuff.. first try making a form.
2- file size, read
http://www.php.net/manual/en/function.m ... d-file.php
http://www.php.net/manual/en/function.i ... d-file.php
3- IP stuff,.. you will have to store them in a DB (mysql.org)
4- displaying a link, very standard issue, search the forum. You have to read a directory of your server and echo them.
check here:
http://www.php.net/manual/en/function.readdir.php
http://www.php.net/manual/en/function.is-file.php

and try to do it yourself, and post here your questions.. we will help you.
ryan
Forum Newbie
Posts: 5
Joined: Sun Jan 25, 2004 9:07 am

Post by ryan »

Thanks for the reply dude
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

You can use my file upload class i just submitted into the code snippet section of the site. It will do all what you want except limit the uploads per IP, but you can just add that feature on.

viewtopic.php?p=83978

Thats the url to it.
ryan
Forum Newbie
Posts: 5
Joined: Sun Jan 25, 2004 9:07 am

Post by ryan »

Thanxalot but i would rather try and do it myself(well with a tutorial) anyone know of a good upload form tutorial? soory but i'm a complete n00b :P
ryan
Forum Newbie
Posts: 5
Joined: Sun Jan 25, 2004 9:07 am

Post by ryan »

kettle_drum just looked at your class and i think it will actully help me learn PHP just as good as a tutorial :D

Thanx alot
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Yeah, just follow it through and figure out what everything does then try and have a go at replicating it all. Its pretty simple stuff once you gte your head round it.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

Like kettle_drum said,.. the best "learning" practice.. is to analyze a script.. use it.. and then make your own.... cheers
Post Reply