6 Replies - 841 Views - Last Post: 10 November 2011 - 07:13 AM Rate Topic: -----

#1 Boyan  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 254
  • Joined: 09-September 07

Need some application planning advice

Posted 10 November 2011 - 05:09 AM

Hello guys!

I need some advice from you, hope you can help me.

I'm working on my very first full project, that includes PHP scripts, MySQL DB and CSS/HTML design. It's basically an image upload and hosting service, that should allow user accounts, registration and photo album management. It's not a commercial project, it's just something that will help me understand the principles or programming and organization.

I will be working with PHP for the first time ever (one of the goals of this is learning the language). I already have a scenario that is too long to post it here, so I'll be quick explaining what I actually need help with.

I have planned the DB, containing tables: USERS, ALBUMS and IMAGES. Hope that's ok, if someone else have any different ideas, please post it if you want. What I really need help here is the scripts. What scripts I should/can use for best performance? Here's what I had in mind and on paper:

- Registration.php (a script that will allow the users to register new accounts)
- Login.php (a script that will allow the users to login)
- Upload.php (of course, the script that will upload the images to the server/database)
- CreateNew.php (this should allow users to create new albums to store their images)

And now I'm wondering how to do the whole user account panel. Any suggestions what would I need? I'm kinda stuck here with the planning, totally crushing into a dead-end.

If someone can help me further, I'd be very, very grateful. You guys always been helpful, that's why I'm asking you again. :)

THANK YOU!

P.S. I hope this thread doesn't break any rules, because there is no code, and there is no code because I haven't wrote any yet. I'm also positive that this thread might also be useful to new programmers like me.

THANK YOU AGAIN!

Is This A Good Question/Topic? 0
  • +

Replies To: Need some application planning advice

#2 Jstall  Icon User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: Need some application planning advice

Posted 10 November 2011 - 05:28 AM

Hiya

If you are just starting with PHP I have a few suggestions for you.

First when you are dealing with database access I suggest you use PDO. There are some good PDO tutorials on this site that can help get you started. You should avoid using the mysql* type functions(mysql_query etc) as they are deprecated and not as secure as PDO.

For image processing I have used the GD library in the past and found it adequate.

When storing user passwords it is good practice to salt and hash them.

You definitely want to look into using functions this tutorial outlines allot of reasons why.

You should also learn about object oriented programming. this tutorial can get you started there.

In terms of how to get started, I know how things can seem overwhelming when you look at a new project, using a new language all at once. I have always found breaking a project into components and tackling them one at a time can make things much easier and less intimidating.

For example, you could start by focusing on creating your database schema and getting the registration section working. Just worry about getting a user registered. After that, tackle the login etc.

When you get stuck Google and DIC are your friends :)

Hope this helps, good luck! :)
Was This Post Helpful? 2
  • +
  • -

#3 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 943
  • View blog
  • Posts: 2,353
  • Joined: 15-February 11

Re: Need some application planning advice

Posted 10 November 2011 - 05:39 AM

Before jumping into a project it's always smart to learn the language you're going to use. Check out this links
Favorite PHP Book
Getting Better At Programming (PHP)

There are many tutorials on here and the internet that will show to you do various things.
Was This Post Helpful? 1
  • +
  • -

#4 Boyan  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 254
  • Joined: 09-September 07

Re: Need some application planning advice

Posted 10 November 2011 - 05:49 AM

Hello guys and thank you for your advices and effort! Yes, I'm learning PHP and I advanced from the newbie level. I'll just learn it further while working on this project. I have some (academic) experience with programming, so learning new languages isn't not the hard part. The hard part is building working projects from scratch. :)

But as I said, I'm stuck on the planning. The whole login/register concept doesn't get me the trouble like that's what's happening after. User behavior, the panel and the whole thing about what the user could do once he logs in gives the sleepless nights of writing down the plan.

Like Jstall said, I need to break the project into small parts and I'm having a trouble defining those parts. I know the details will be revealed to me as I go, but I need some starting tips. Like a list of the scripts and pages I'll be using. :)

Thanks again!
Was This Post Helpful? 0
  • +
  • -

#5 Jstall  Icon User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: Need some application planning advice

Posted 10 November 2011 - 06:42 AM

Hello,

What you have now is a good basis for starting the project. If you are concerned about tracking if a user is logged in etc you may want to look at sessions.

If you require the user to be logged in for some of the functionality you can use sessions to track if a user is logged in.

Another note, I suggest you look into the concept of code separation. It is good to get into the habit of separating your PHP/HTML/CSS/Javascript into separate files. This will make your projects much more readable and maintainable. It's a good habit to get into right from the beginning.
Was This Post Helpful? 1
  • +
  • -

#6 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2834
  • View blog
  • Posts: 9,740
  • Joined: 08-August 08

Re: Need some application planning advice

Posted 10 November 2011 - 06:43 AM

Treat PHP like you would any other language in that organization is key. Use functions, objects, and keep your languages separated (there's a reason we have .js, .html, and .css files). Be sure you understand that PHP runs on the server while HTML, Javascript, and CSS are processed by the browser after PHP has been run. That has implications for how you write your code.

Also, treat super globals like any other variable, so there's no need to do something like this:
$name = $_POST['name']; // Waste of processor cycles!


Was This Post Helpful? 1
  • +
  • -

#7 Boyan  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 254
  • Joined: 09-September 07

Re: Need some application planning advice

Posted 10 November 2011 - 07:13 AM

Thanks to everybody who responded! The sessions will be a crucial part of the application. Also, I will need something that will yield tagged links after the photo is uploaded, you know, like HTML tags, BBC and thumbnails. Something that will allow the user to share the image. Is there a working script for this that I can use? Not that I cannot code it manually, but if would be nice if I can see how that actually works. :)

Thank you again guys, you helped me a lot. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1