1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Just a lil question for anybody that know's php

Discussion in 'BlackHat Lounge' started by TimSB23, Jan 27, 2012.

  1. TimSB23

    TimSB23 Newbie

    Joined:
    Sep 12, 2011
    Messages:
    37
    Likes Received:
    5
    Occupation:
    Crew/Dishwasher
    Location:
    Florida
    Home Page:
    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?
     
  2. bastienvans

    bastienvans Newbie

    Joined:
    May 3, 2009
    Messages:
    20
    Likes Received:
    2
    Start by learning php. What you are asking for is very easy to do for someone with minimal php knowledge.
     
  3. dtang4

    dtang4 Regular Member

    Joined:
    Apr 7, 2010
    Messages:
    291
    Likes Received:
    43
    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.
     
  4. TimSB23

    TimSB23 Newbie

    Joined:
    Sep 12, 2011
    Messages:
    37
    Likes Received:
    5
    Occupation:
    Crew/Dishwasher
    Location:
    Florida
    Home Page:
    ok and to rename it could that be an automated process? I'm on w3schools studying php now
     
  5. Tensegrity

    Tensegrity Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 22, 2009
    Messages:
    1,824
    Likes Received:
    969
    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: Jan 27, 2012