Question for those who have built their own PHP sites.

Oct 19, 2000
17,861
4
81
I'm attempting to use my newfound knowledge to build a completely new site from scratch. It's simply intended as a learning tool for myself, nothing I plan to commercialize. However, I'm finding it difficult at times to properly work step by step through building everything. I'm constantly questioning myself as to what I'm working on next. I also wonder if my current plan of action is "normal", where I'm basically trying to code the basics of everything, then go back and tighten everything up, from ELSE errors/redirects to better security to the design of the website itself.

I know it's an open-ended question, but how do you guys usually tackle a new site? I'm wondering if the site I'm working on might be a bit much for just one person, but I've always thought big . Thanks for any commentary on the subject.
 

reverend boltron

Senior member
Nov 18, 2004
945
0
76
Well, you have to tell us what the site is first. It all really depends on what you want to do and how you plan on doing it.

I have built my own CMS from scratch with MySQL and PHP. It wasn't too huge of an undertaking.

One of the most important things about programming in general is having a vision of what you want to accomplish. Once you know what you want to do, then you can start figuring out how you want to do it. Once you figure out how you want to do it, then you can start attacking it in pieces.
 

TeamZero

Senior member
Apr 14, 2004
519
0
0
Originally posted by: reverend boltron
One of the most important things about programming in general is having a vision of what you want to accomplish. Once you know what you want to do, then you can start figuring out how you want to do it. Once you figure out how you want to do it, then you can start attacking it in pieces.

QFT...programming is all about problem solving. First you need to plan what you need to do to solve the problem (the problem in a general sense being your lack of a website in this case), then do it in phases or pieces.

For instance at work, we design the site first. Once that is approved, we start writing functionality and database functions. Then we do back-end admin controls.

 

clamum

Lifer
Feb 13, 2003
26,255
403
126
I agree with the above two posters. You need a solid plan that details what you want to accomplish and after having this it makes it easier to tackle the problem and solve it.

The first thing I do with my websites is figure out the database requirements and schema and create that. After that I usually get a general site layout thought of and create that (usually use someone's three-column liquid CSS layout) and get the basic color theme together. Then it's on to implementing features piece-by-piece.
 
Oct 19, 2000
17,861
4
81
Originally posted by: reverend boltron
Well, you have to tell us what the site is first. It all really depends on what you want to do and how you plan on doing it.

I have built my own CMS from scratch with MySQL and PHP. It wasn't too huge of an undertaking.

One of the most important things about programming in general is having a vision of what you want to accomplish. Once you know what you want to do, then you can start figuring out how you want to do it. Once you figure out how you want to do it, then you can start attacking it in pieces.

The site I'm working on is a type of CMS as well, albeit highly specialized towards the subject matter I'm working with. I was mainly wondering if others typically did the meat of the code first, then clean up security and design issues later, or if design was paramount, then you coded around that, etc.

The method I'm taking right now is that I designed my basic layout for each type of page I'll have, and simply have graphic placeholders everywhere, with generic text. Once I get the basic code to where I want it, I'll go back through and attempt to clean it up a bit, working on security and streamlining it to the best of my ability. Then I'll head back to the CSS and finish up the design around what my code adds to the page.

Just curious how others tackled stuff like this, and if I was wrong in my methodology in how I approached it. Since I'm 100% self-taught at this point, I have no reference point on how to "correctly" build a site, although I'm sure there is no one correct way.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
For security, it should be something you're thinking about with every line of code you write. It's far easier to write secure code once, then to write messy code and have to redo huge portions because it's not very secure. What's the point of writing a bunch of DB queries that are subject to SQL injection if you are just going to have to rewrite them later? For the most part security is all about discipline while coding.
 

jjones

Lifer
Oct 9, 2001
15,425
2
0
I usually section the work up and then go at it each section at a time being as thorough and complete as possible as I go along. Security and code efficiency is always a priority through each step. I try not to leave anything for later.

The way I usually work on a project is like this:

1) First, everything I can think of that the website will feature goes down on paper in a sort of rough draft form. The entire site is roughed out including any sections/modules, login, dynamic features, etc.

2) Then I go to design and start doing mockups in a graphics program. I'll do a mockup for every unique type of page but here I will use placeholders for text and general images where needed, but not graphic details like buttons, borders etc. Graphic detail the site will use will all be worked out at this time and as complete as possible.

3) Next I do a home page and begin working on the security and overall backend. I always break up the home page into into modules to be used for the rest of the site: global, header, menu, footer, login (if used), etc. This I will do to maximum completion because from there, for the most part, it is just making new sections and working on stand alone modules.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I am working on a web development using php course at the college where I work. I preach the test cases. Break your code up into unit tests and write code that passes the tests, the path becomes much more clear when you work that way. When I have 'real' work I use this method. I usually create classes/methods/functions that meet the tests laid down, then I just format the output to look pretty.
 

911paramedic

Diamond Member
Jan 7, 2002
9,450
1
76
Functions, lots of functions. Chop the site up into small pieces that may get re-used and put them in something like functions.php and include that file. (login script, date, whatever)

And, like the first few people said, figure out what you want first or you will be writing your code in circles.
 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
Originally posted by: 911paramedic
Functions, lots of functions. Chop the site up into small pieces that may get re-used and put them in something like functions.php and include that file. (login script, date, whatever)

And, like the first few people said, figure out what you want first or you will be writing your code in circles.

thats the advice i gave a cousin about a year ago.

6 months later when he came to me and showed me his first "php masterpiece"
it was one index file that included a functions.php, had dozens of mod rewrites and a big spaghetti mess of conditionals with nothing but oddly named functions

i'm certainly a fan of re-using code
but in order to learn the best way of code management, you need to retype it a few times
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |