Form Processing

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

Should developers create their own php or use what's already created.

Create your own, take the time to learn PHP!
16
80%
Why reinvent the wheel?
4
20%
 
Total votes: 20

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

guys, we're getting quite a ways off topic here (as it pertains to the post, not the poll) .. I'd suggest we break off and create a new thread if you want to continue this debate.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Sorry Feyd...but I couldn't resist :P

I for one...enjoy re-inventing and consider myself more than capable of writting solid PHP classes/libraries even when I start from scratch...

Most PHP libraries are not so complex that the basics and even advanced topics can't be picked up quickly and implemented in your own classes...

By looking at existing code bases like d11's and phpMailer you can learn everything you need to know and more, as you can take positives from each and join them togather to form one. I do that all the time...

Thats the beauty of being last...ever heard the expression:

"The early bird may get the worm, but it's always the second mouse that gets the cheese"

Personally I've always liked that saying...as to me it suggests...fret not being first but focus more on being best

Did that even make sense? was that correct English grammar? If it is...I think I'm gonna copyright that... :P Maybe get quoted again *pulls pants up by belt line* :P

Anyways...the point... 8)

There is no harm in re-inventing the wheel...infact thats how I pretty much learned everything I know in regards to computers...I learn from the bottom up...and learn as I go...

However, when your writing production code with deadlines and such....it makes sense from a professional standpoint to maybe look into using existing codebases...

So really...it depends on what your coding and for whom...

Cheers :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Form Processing

Post by RobertGonzalez »

cupaball wrote:Hi All,

Can someone point me in the direction to find help (tutorial or some code) in creating a php code. I have a form with First name, last name, phone, email, address, city, state, zip, and comments. I would like all the info emailed to an email address (the easy part, already done) and also write everything except the comments to a MYSQL database.

As I said, I have completed the first part using ezformmail, but I want to write the data. I have written data to database before, but I have never combine the two. If I can't use ezformmail and have to create a new php script, I will need it validate the fields before sending.
If the first part (emailing) is done, and the second part (inserting into a database) is something you have done before, and you are only talking about validating and inserting eight fields, why not build it yourself? I mean, seriously, you are talking maybe another 50 lines of code added to what you already have and it's done.

As for the poll question, this thread and poll posted a similar question and it has almost turned into a completely separate project.
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

Post by cupaball »

Thanks, so I can jsut add the db insertion to end of the code?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

I don't know why but I'm going to check in on this one.

1. I like learning by reading other people's code and then at some point try to make something conceptually similar. It's a valuable learning exercise.

2. I might use said code in a personal project (personal site).

3. For a professional projects where reliablity is a must, I stick with trusted and tried libaries for DB abstraction, mailing, templating and so forth. I don't see the point of rewriting all of those libraries.
Li0rE
Forum Commoner
Posts: 41
Joined: Wed Jun 07, 2006 6:26 am

Post by Li0rE »

I never use tutorials or anything and my scripts are better than anything out there.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Li0rE wrote:I never use tutorials or anything and my scripts are better than anything out there.
Awesome, we found God's gift to PHP development :roll:

Sorry, it's just that your comments sounded so arrogant.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Li0rE wrote:I never use tutorials or anything and my scripts are better than anything out there.
From the guy who just learned about mysql_insert_id() a few days ago. ;)

I use tutorials and anything I can find and I see code every day that is doing something in a smarter way that I am currently doing it -- so I go back and refactor my code.
(#10850)
Jixxor
Forum Commoner
Posts: 46
Joined: Wed Jun 07, 2006 5:53 pm
Location: Lakeland, FL

Post by Jixxor »

For me, personally, coding my own libraries and such give me an edge. I'm tackling something I don't understand in an attempt to make it simpler for me in the long run, and in the process I'm learning more about the language I'm coding in. Of course I use tons of sources to help me out and give me ideas, but in the end the coding is all hand-written, no copy & paste.

I think that when a person gets used to just using what has already been written, they become somewhat of a script kiddie, copying & pasting here and there what they need - and it's a good bet that they don't understand what they're copying & pasting. Of course this isn't a good thing, this produces coders who might be able to finish up large projects, but they don't understand how they did it... as long as it works right? This produces messy code and a headache for the end user imho.
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

Post by cupaball »

Well, I have completed what I set out to do but I need to add a step. I need to give the option to add the contact info to the database, something like if the box is checked then add the info. Only b/c some people may not want there info recorded.
Post Reply