Faqts : Computers : Programming : Shopping For You : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

526 of 670 people (79%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

What's the best way to start writing a PHP program?

Dec 17th, 2009 03:33
sonu singh, mohamed helmy, Fasee Uddin, Casino Vendor Directory, Admin faqts, Joe Bloggs, s3odia s3odia, John Martin, Scott Mandarich, marshal prince, osososo didididi, jack uter, Taksh Verdhan, healthy man, haytham ali, dwi h, dman, forum net tr, ha mo, foo bar, Dave Goose, Heini van Bergen, Philip Olson, Abdel Wahab Salah, Nathan Wallace, http://www.nighthawks.co.in http://www.buygranites.com


Design, design, design. Figure out, on paper, exactly what you want to
do.  Otherwise, you'll just be coding your way around with no real 
goal.
Plan on separating content from logic, it'll always assure cleaner, 
more maintainable code. 
Usually the apps I write are DB-related, so to use that sort of
application as an example, the first step would be nailing down, with
fairly broad scope, what sort of data needs to be stored.  This doesn't
have to mean tracking down every possible facet of information that 
will ever be pertinent, just get a good idea.  Part of the app design 
may call for it to be extensible anyway, so you don't have to know
everything ahead of time.
Once you have a good understanding of what data needs to be stored,
design your database.  Flow charts are your friend. :)  Having a
visualization of the structure of the DB will come in handy for
subsequent steps.
Now it's time for an interface between your app and the database.  I
generally avoid putting direct DB calls in my app as much as possible,
your feelings may vary.  Now that Pear is around, I've been using that
for my abstraction.  There are other options, of course.  I tend to
write three functions for each logical grouping of database fields.  
For example, if it were a web log, there may be some groups of fields 
such as Users, Entries, Categories, and Polls.  For these, I would 
write getEntry, setEntry, deleteEntry, getUser, setUser, deleteUser, 
and so on.  I may not find a need to use all these functions, but 
being able to assume they're there if I come to that point later on is 
handy.
Usually for me the next step is the administrative portion of the app.
The screens involved in (using the web log example) logging in as a
user, posting a new entry, and perhaps adding a poll.  The admin
interface tends to have three components to it: The navigation, the
forms for input, and the code for validating/DB access.
http://www.trendwebz.com
http://affordableorganicseo.blogs Since
separating content from code is good, I tend to have these three
components thoroughly separated.
The navigation can be done any number of ways, I tend to use button 
menu screens (You log in, get a Main Menu, click on 'Manage Users', 
get a User Menu, click on 'Add User', get an Add User form, etc.)  For 
form input, I like to make my forms dual-purpose.  That is, the same 
file can be used for adding a user as it can for editing.  It's a 
simple process, and it's handy for keeping maintenance hassles low.  
These forms, of course, submit their data to the code that does 
validation and DB access.
So that's the admin side, more or less.  Once that's all in place, the
only thing left to do is the actual web pages that people will be 
using.  I'm no designer, so I don't relish this part.  Thankfully, I 
work with people who are designers, so often while I'm coding the 
admin side, they're doing up the templates for the site.  Then 
integration is just a matter of plugging in snippits of PHP to extract 
a value here, interate through some DB fields there..  Pretty soon, 
it's all done.  (Okay, so it usually doesn't seen like 'pretty soon' 
when it actually gets finished).
Okay, I'll stop rambling now.
Also, choosing a PHP aware editor helps, and PHP developmental tools.  
Zend.com is a company dedicated to PHP and offers many great products 
and tools, check them out.  As far as PHP friendly text editors and 
related tools go, check out these links:
http://www.nighthawks.co.in
http://www.contactindianhotels.com
http://www.buygranites.com
http://www.buystonesonline.com
http://www.mahimawholesalejewelry.com
http://www.jaipurbandhej.com
http://www.celestialindia.net
http://www.kareemhandicrafts.com
http://www.websitesofhotels.com
http://www.goodtimepass.com
http://www.heritagehotelsinrajasthan.com
http://www.silverwholesalejewellery.com
http://www.indianmedicaltourism.com
http://raidoar.blogspot.com/
http://radiomasrawe.blogspot.com/
http://radiorrr.blogspot.com/
http://qqqradioqqq.blogspot.com/
http://alradio5.blogspot.com/
http://alradio5.blogspot.com/
http://xblogradiox.blogspot.com/
http://0radi0.blogspot.com/
http://raidoraido.blogspot.com/
http://radioeg.blogspot.com/
http://healthcare.jimdo.com/resources
http://healthcare.jimdo.com
http://healthscare.webs.com
http://healthscare.webs.com/resources.htm
http://www.prosolx.com/health.html
http://www.probizx.com/professional/doctor.html
http://www.webdirectorysbwebx.com/health/medicine.html
http://www.prosolx.com/insurance.html
http://www.probizx.com/corporate-management/insurance.html
http://www.webdirectorysbwebx.com/finance/insurance.html
http://finance-advice.freevar.com/links.html
http://finance-advice.freevar.com
http://www.prosolx.com/finance.html
http://www.probizx.com/corporate-management/finance.html
http://www.webdirectorysbwebx.com/finance/finance.html
http://dir.probizx.com/finance/financial-consultants.html
http://www.probizx.com/business-consulting/education.html
http://www.dir.probizx.com/internet/online-education.html
http://www.webdirectorysbwebx.com/internet/online-education.html
http://www.prosolx.com/education.html
http://www.dir.probizx.com/finance/law.html
http://www.prosolx.com/law.html
http://www.webdirectorysbwebx.com/finance/law.html
http://www.probizx.com/professional/law.html
http://www.casinonrock.com/
http://jackport.jimdo.com/tips-for-gambles/ pr1
http://jackport.jimdo.com
http://freedating.services.officelive.com
http://onlinedatingomnidate.wordpress.com/ pr1
http://pet-shop.jimdo.com/useful-reference/
http://expertz.jimdo.com/partners/
http://watchstyle.jimdo.com/
http://art-mine.jimdo.com/
http://shopvia.ueuo.com/resources.htm
http://www.gift4u.probizx.com/resources.htm
http://www.gift4u.probizx.com/shopping.htm
http://www.gift4u.trendwebz.com/resources.htm
http://www.gift4u.trendwebz.com/Gifts.html
http://www.webdirectorysbwebx.com/shopping/clothing.html
http://www.dir.probizx.com/shopping/beauty-products.html
http://www.webdirectorysbwebx.com/shopping/clothing.html
http://german-shepherd.jimdo.com
http://pet-shop.jimdo.com/useful-reference/
http://www.gift4u.probizx.com/petsupplies.htm
http://dir.probizx.com/shopping/pets.html
http://www.directory.prosolx.com/shopping/pets.html
http://www.webdirectorysbwebx.com/shopping/pets.html
http://realestate.6te.net/partners.html
http://expertz.jimdo.com/partners/
http://www.luxury-rentals.probizx.com/resources.html (choose category)
http://www.dir.probizx.com/shopping/home-decorate.html
http://www.webdirectorysbwebx.com/shopping/home.html
http://www.gift4u.probizx.com/homeImprovement.htm
http://www.luxury-rentals.probizx.com/resources.html (choose category)
http://expertz.jimdo.com/luxury-travel/
http://traveleguide.wordpress.com/
http://www.probizx.com/professional/travel.html
http://www.webdirectorysbwebx.com/tour-travel/travel-organizations.html
http://www.sbwebx.com
http://www.sbome.com
http://www.sbwebx-solutions.blogspot.com/ pr2
http://freelancers.design.officelive.com/UsefulReference.aspx
http://www.probizx.com/resources3.html
http://www.webdirectorysbwebx.com/internet/internet-marketing.html
http://www.prosolx.com/website-promotion.html
http://www.trendwebz.com/internet/seo.html
http://www.webzclick.com/internet/seo.html
http://www.services.webzclick.com/link.html
http://www.probizx.com
http://www.probizx.com/web-solutions/website-hosting.html pr1
http://www.probizx.com/web-solutions/website-promotion1.html pr1
http://www.probizx.com/web-solutions/website-promotion.html pr1
http://www.probizx.com/corporate-management/buisnesses.html pr1
http://www.probizx.com/business-consulting/education.html pr1
http://www.probizx.com/business-consulting/project-consultants.html pr1
http://www.probizx.com/resources.html pr2
http://www.probizx.com/offshore-outsourcing/information-technology.html pr2
http://www.probizx.com/application-technology/ajax.html pr3
http://www.probizx.com/resources4.html pr3
http://www.prosolx.com/e-commerce.html
http://www.prosolx.com/seo.html pr1
http://www.prosolx.com/finance.html
http://www.prosolx.com/law.html
http://www.prosolx.com/medical-science.html
http://www.prosolx.com/foods-drinks.html
http://www.prosolx.com/homes-gardens.html
http://www.prosolx.com
http://www.prosolx.com/travel.html
http://www.prosolx.com/web-designing.html
http://www.prosolx.com/hardware.html
http://www.gift4u.probizx.com/resources.htm
http://www.webdirectorysbwebx.com/business/business-to-business.html
http://www.webdirectorysbwebx.com/computer/it-services.html
http://www.webdirectorysbwebx.com/entertainment/celebrities.html
http://www.webdirectorysbwebx.com/industries/engineering.html
http://www.webdirectorysbwebx.com/industries/factory-automation.html
http://www.webdirectorysbwebx.com/internet/search-engine-optimization.html
http://www.webdirectorysbwebx.com/tour-travel/travel-service.html
http://www.webzclick.com/business/real-estate.html
http://www.webzclick.com/entertainment/television.html
http://www.webzclick.com/industries/calibration-testing.html
http://www.webzclick.com/industries/coating-lamination.html
http://www.webzclick.com/internet/internet-marketing.html
http://www.webzclick.com/internet/softwares.html
http://www.webzclick.com/shopping/beauty-products.html
http://www.webzclick.com/shopping/jewellery.html
http://www.webzclick.com/shopping/product.html
http://www.webzclick.com/shopping/weapons.html
http://www.webzclick.com/travel/car-hire.html
http://www.webzclick.com/travel/cruises.html
http://civilwarcommand-civilwar.blogspot.com
http://www.armorvenue.blogspot.com
http://pet-shop.jimdo.com
http://armorvenue.wordpress.com
http://armorvenue-ww2weapons.blogspot.com
http://civilwarcommand.wordpress.com
http://civilwarrifle.blogspot.com
http://historicalpiratecostumes.blogspot.com
http://carcustomzheadlight.blogspot.com
http://expertz.jimdo.com
http://newhollywoodbeautyparlor.jimdo.com
http://probizx.co.cc
http://historicalcloth.wordpress.com
http://dubai-rentalsapartment.blogspot.com
http://civilwarclothing.blogspot.com
http://www.sbwebx-solutions.blogspot.com
http://civilwarcommand-civilwarweapons.blogspot.com
http://www.mytoureguide.com
http://www.seoteck.com
http://www.adsvianet.com
http://www.shopvianet.com
http://www.casinonrock.com
http://www.traveletour.com
http://www.specialplanner.com
http://www.thefullcare.com
http://seo-sem.freehosting.net
http://directory.prosolx.com
http://www.dir.probizx.com
http://www.webdirectorysbwebx.com
http://webzclick.com
http://www.trendwebz.com
http://affordableorganicseo.blogspot.com
http://carcustomzheadlightprotection.blogspot.com
http://realtyrally-realestate.blogspot.com
http://realtyrally.wordpress.com
http://probizx-solutions.jimdo.com
http://freelancedesigner.jimdo.com
http://sbwebx.jimdo.com
http://armorvenue.jimdo.com