Where do I start?

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
Kureigu
Forum Newbie
Posts: 8
Joined: Wed Jan 31, 2007 2:45 pm

Where do I start?

Post by Kureigu »

I have a couple of questions that maybe someone with experience could answer for me...

The situation is...

I need to make a website for a personal project. It will be mainly based around the users and websites that sign up.
Basically I need to know what I have to learn to make a Sign up system, that allows users to register with their portfolio(images, etc) or allows sites to register with their site details and info.
I also need to make a management system to control what sites and portfolios are shown on the front page. I intend to feature a single site and single portfolio on the front page, and have a list of newcomers also.

I would just like to know what I would have to learn to be able to do this myself, and find out where I'd even begin to do this.
The HTML and web design part is not a problem, it's just the PHP.

I'm not a total newcomer to PHP, and have a basic knowledge of the code and a few functions. I don't need told what strings or funtions are, etc.

Apologies in advance for any stupid questions I ask regarding your replies.

Thanks
NEWDAY
Forum Newbie
Posts: 12
Joined: Wed Jan 31, 2007 5:15 pm

where to start

Post by NEWDAY »


Hello...

this is a complete project, and I cant solve it all for you but I can direct you where to start...

First you need to create a simple form-based user authentication and you'll find a helpful article in this site:

http://www.devarticles.com/c/a/PHP/PHP- ... Beginners/
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

What your asking is no simple task for a new programmer. If you want to know what you need to learn, it is PHP and SQL, and a good bit of it.

SQL handles the databases, PHP handles how the information is added to and read from the databases, as wel as the entire authentication process. And if you want a bit more instant interactivity, AJAX may interest you. None are particularly easy to understand at first, but they grow on you.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

Adding to what others have posted, yes, you have described a rather comprehensive web site and as you recognized, you have some learning to do. You're starting in the right direction, asking for specific areas to study and not expecting someone else to design your application for you. So I'd say you are already beginning what you have to do. My only addition to what has already been posted is that you might want to try to obtain the source code for one or more sites that do something similar to what you want to do. As you know, you can't just "View Source" in your browser, since the PHP code never leaves the web server, so you might try asking webmasters of sites that look something like you want. Some may be happy to share their code with you. Another route would be to find some good books or tutorials. There are lots of both around. The trick is to find one that is directed at the kind of functionality that you want. Good luck!
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

If time is no object, I say write it yourself. The learning experience would be fantastic!

If time is a consideration, perhaps you should look into installing drupal or something similar in the meantime.
Kureigu
Forum Newbie
Posts: 8
Joined: Wed Jan 31, 2007 2:45 pm

Post by Kureigu »

Luckily time is no object. I'd prefer actually to do it myself for learning purposes, and to get some satisfaction from knowing that I'd made it myself. I always figure that there's no use including code if you don't even understand it.
I think I need to familiarise myself with SQL usage through PhP seeing as it looks as if it will play a major part.

I had a quick look at that tutorial. It might prove useful, even if it's just something to keep me on track.

I just realised I'll have to have a search function to search portfolios and site info. Would it bee a good idea to add this on after the log in system, or try to build it all in at the same time?

It all gets so overwhelming so fast. I think perhaps I should work on a very basic system first and grow from there.

Thanks for all the adivce so far. It's been helpful.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

do it in pieces, testing as you go. That way you don't have to look as hard for the errors (and there will be errors!)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

I'd highly suggest that you do not START with the hug project; maybe some small projects... Start by generating things on-screen through code, then maybe interactivity.... Just attempting to write it will cause you problems when you try to understand what it is that you wrote (also, beware when using other people's scripts... you'll probably get a little lost)

Take the time to LEARN the material rather than copy and paste; It'll serve you're purpose much better.
User avatar
da404lewzer
Forum Newbie
Posts: 8
Joined: Fri Jan 26, 2007 1:00 pm

Post by da404lewzer »

here are some things you might find useful for what you are doing...

Dynamic Pages
if you want to be able to have one page handle multiple pages easier, try this.
http://www.coderwiki.com/wiki/PHP:Tutor ... Navigation

A Login System
if you want them to be able to login this is pretty cool, it uses classes, so it might be a bit weird to look at. but it handles registrations as well.
http://www.phpbuilder.com/columns/tim20000505.php3

Storing Images to files AND resizing:
http://www.blazonry.com/scripting/upload-size.php
OR

Storing Images to a Database
http://www.wellho.net/solutions/php-exa ... reive.html
if you are storing them to a database you will most likely want to resize them. there are very good resizing examples in the user comments:
http://us2.php.net/manual/en/function.imagejpeg.php


from all of this jibberish, you should be able to figure out how forms work. forms submit to $_GET or $_POST arrays depending on your form method type, so google these to understand them better.

the image stuff will prolly be the hardest.

i would start with getting index.php setup, from the above example and creating seperate include files for all the things it does, like a gallery script, and maybe your default page, and about page, your member settings page, etc..

MySQL - search these on php.net (it will be your best friend)
mysql_connect() - connect to a mysql server
mysql_select_db() - select which db to use
mysql_query() - execute a query
mysql_num_rows() - get the number of returned results, used for avoiding errors of looping empty arrays :(
mysql_fetch_array() which i like over mysql_fetch_row() because you dont have to use list()
mysql_insert_id() - handy for getting the id of and verifying your last insert
mysql_affected_rows() - handy for verifying your insert/updates


i hope these help.. did i forget anything? oh ja, if you have questions, post here or in the code help category..
Kureigu
Forum Newbie
Posts: 8
Joined: Wed Jan 31, 2007 2:45 pm

Post by Kureigu »

Thanks a lot guys. This should keep me busy for quite a while.

Luckily I already know about $_POST from doing forms where it has to send information to a mail() function for a contact page.
As I say, I'm not a complete newbie. I just need practice to consolidate what I've read.

I'll take a look at all of those tutorials when I have time, thought I may end up just reading them several times and coding my own way. As I've said before, I'd rather understand that just copy.

Does anyone know of any free SQL/PhP hosting for me to test things on temporarily? My own computer with PhP and Dreamweaver is down right now unfortunately :(
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Free? I'm sure you can emulate them on Windows/Linux. Google "offline php," "offline sql," and check out XAMPP
Post Reply