Just a lil question for anybody that know's php

TimSB23

Newbie
Joined
Sep 12, 2011
Messages
33
Reaction score
5
I have a question I know what I want a website to do but im not quite sure of how to do it and what I need to learn to do it. Well I think I can do it with php. I want to make a website that a user can log on a upload a picture and it post on my website but when they upload it I want it to go up under a certain category that they specify during the upload. I'm not sure if I said it clearly but do anybody know where I should start during the research?
 
Start by learning php. What you are asking for is very easy to do for someone with minimal php knowledge.
 
You can do that w/ php and mysql

In your mysql table, you will want to store the image attributes (e.g. pictureid, userid, category, name, caption). It is also better to rename the file the pictureid dot extension.
 
ok and to rename it could that be an automated process? I'm on w3schools studying php now
 
I have a question I know what I want a website to do but im not quite sure of how to do it and what I need to learn to do it. Well I think I can do it with php. I want to make a website that a user can log on a upload a picture and it post on my website but when they upload it I want it to go up under a certain category that they specify during the upload. I'm not sure if I said it clearly but do anybody know where I should start during the research?

You can start by posting in the Programming forum instead of the Lounge.

But, just so I'm not a total dick, here are some pointers...

There are two basic ways of storing data:
1) into a database (most likely mysql, but there are others)
2) in a file

Storing data and retrieving it from files is much faster than using a database. So for that, look into fopen() for read, writing and appending to files, and look into explode() and implode() and array functions for handling the data once you retrieve the data.

The first thing you should do is write a script to accept uploads. You're going to run into a problem with file sizes and what your server accepts, so you'll need to adjust that in the php.ini and/or other places on your server.

Then you need to decide how you're going to handle the file after it gets uploaded. Will you be accepting file attributes manually submitted by the user or will you be determining those attributes by analyzing the file meta data itself or both? Handling user submitted attributes is a simple matter of handling the $_POST or $_GET global variables after the form is submitted. Handling file metadata is a whole other monster because all file types are subject to storing the metadata differently, so as a beginner you may want to only deal with handling user submitted data, the filename and the file location cuz that is a lot in itself.
 
Last edited:
Back
Top