Results 1 to 8 of 8

Thread: Where would I start to code a php site that I want to create?

  1. #1
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Where would I start to code a php site that I want to create?

    Hi all,

    K so I have been for a while looking to create a site where (for now) students are able to post their pictures of their artwork online.

    For now it would have some basic features:

    1. Registration for multiple users
    2. Upload images
    3. Let users comment on images (with notifications)

    Where would I start? I know some html pretty well and some css. and I understand a tiny bit of php. I understand that the common answer to my question would go read some tutorials about php. But that's not why I'm here. I need a direction to go to really.

    Here is an example: http://www.shaischechter.com/art/gallery/

    Any advice?
    Thanks.

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    Maybe the simplest way to get something like that up and running would be to use a cms, drupal or joomla could certainly be used, and you may even be able to do it with wordpress ( which is the easiest to get started with).

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    If you want to code this yourself, then the first thing to understand about PHP is that it's a set of tools with which you must create a website. This means that if you break it down to simple steps (upload an image, for example) then you can work through these individually. After a while, the big picture will start to come together, but if you try to approach the big picture in the first place, it will probably be too overwhelming. Honestly, it's best to start with some small projects, though a big project like this can be great motivation to learn as well.

    The good news is that PHP is widely documented on the internet and the official website is helpful. php.net has a full list of all functions available and how to use them.

    For the basics use a tutorial. Then start, slowly, trying to put together some components for what you want to use.


    Secondly, the other thing to understand about PHP is that there are two aspects to a dynamically generated site: the code base and the content. Keep them separate as much as possible and you will in the end find everything much easier. Once you start mixing content (html, text passages, etc.) and PHP code (if statements, database functions, etc.) things get messy fast.


    Now if you just want the fastest way to get your project done (potentially with less control) then look at a CMS like azoomer suggested. If your goal is to learn PHP, follow the advice here.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. The Following User Says Thank You to djr33 For This Useful Post:

    bouncer (02-07-2011)

  5. #4
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    Although this might sound like a bit much at this point in your understanding of web design, I feel I should recommend learning a small amount of MySQL coding. There is not much that you need to learn about MySQL except that it is much like a glorified spreadsheet used for storage and retrieval of data such as user comments. MySQL allows you to sort data in many different ways, which in your case would be something along the lines of

    "Display all of the posts relating to image 'X' and order them by date the comment was submitted to the MySQL database."

    Uploading the images is a php based script. Presentation of the retrieved content is CSS/HTML. Storage of lots of text like posts is MySQL. I would put the images themselves in your file system however as images can quickly fill up a database.
    To choose the lesser of two evils is still to choose evil. My personal site

  6. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Yes, a database would be required if you want to build this yourself. If you do use a CMS, though, that will handle the database interactions for you. But you will still need to learn the basics of using databases, such as how to set one up and connect the CMS to it.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #6
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    I don't think I have any experience with cms, so that is good to know that cms does that. I may use cms one day, but I have always preferred typing out the code and then saving the file.
    To choose the lesser of two evils is still to choose evil. My personal site

  8. #7
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the advice.
    Yes I know how MYSQLs work and how to set them up. I also understand php a bit. Just reading , not coding, but barely.

    I need to learn how to code php and how to make it work with mysql. Any good tutorials to start with user registration?

    Username:
    Name:
    Email:
    Password:

    I read a bit about the user registration. I know now that php5 i believe it is? uses rasterize and validate strings. I read a tutorial how to create a registration here: http://net.tutsplus.com/tutorials/ph...ship-with-php/ but haven't started making it yet.

    The good thing about that tutorial is it has php code to escape string, which is to prevent mysql injections if im right? but it doesnt have validation for email, user, pass etc.

    and maybe some other important stuff that I can't think of right now?

    But yeah my first step is to get a successful user registration (with email activation link hopefully!!!!) and use captcha for anti-spam or something similiar. this is gonna be hard lol.
    Last edited by bouncer; 02-08-2011 at 03:42 AM. Reason: forgot captcha

  9. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Take it slowly and you'll get there.

    While user registration may seem simple, making it secure (and protecting it against bots) can become difficult. So it might not be your best first project-- at least read a lot about hashing passwords, and look into CAPTCHAs, though you can find those for free and they're easy to implement-- try reCaptcha.

    Here's a tutorial that I recommend-- but don't be afraid by the strange layout it's currently using-- the content is good. Start at the earliest [last] post and work toward the more advanced things.
    http://php-mysql-tutorial.com
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •