Jump to content


the next step

  • Please log in to reply
1 reply to this topic

#1 legohead6

  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 31 May 2006 - 04:23 AM

i am what you would call in the middle for lvl of php..i can do sessions, minor form validating...mysql reults hanling and display...ive created a quite good forum and an online auctin site...but i want to be better... all the tutorials get to is sessions i want to go beond...to like validating emails so its someth@something.something and stuff like that! anyone know of good tutorials that take you from that so-so to excellent stage?

"Syntax error" .. WHERE THE **** IS IT?!

#2 .josh

  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 31 May 2006 - 06:01 AM

email validation breaks down into 2 categories: checking the email string for the basic email structure (like, doing a search for @ and . and even a pre-defined list of .com/.net etc..) and is done pretty much soley with [a href=\"http://us3.php.net/preg_match\" target=\"_blank\"]http://us3.php.net/preg_match[/a] and/or [a href=\"http://us3.php.net/manual/en/function.eregi.php\" target=\"_blank\"]http://us3.php.net/manual/en/function.eregi.php[/a]

option #2 is basically doing a call to the target server and seeing if the email really exists. but best case scenario this method tends to be rather slow, so most people just settle for doing a basic structure check, and opt for the "send an email to them with an activation code and they have to use that activation code to complete registration" method. This tends to be the option of choice, as the user would have to have the email address and access it, in order to get the code.

I guess if you haven't done this yet, then you can officially do one to get it under your belt, but I wouldn't exactly call mastering this, any great php feat. Not any more than the other stuff you've learned. It would still put you in the "intermediate" level...

Beyond that, I think your next step would be looking into (if you haven't already) pear, ftp, file handling/manipulation, and working with directory structures. If you've done all that, then look into sockets and object oriented programming with php.

Also, as you go, make sure you keep learning your sql, too, since they go hand in hand. sql queries can get quite difficult to put your head around. doing simple select *'s and delete where blah=blah's will cover most of your database tasks, if you break down everything into several unessesary steps, but one of the main attributes of a professional php scripter is that they do things the elegant way. The shorter the code, the better. With sql queries, less queries = better. Things like relational databases and JOINS and stuff really cut down on the amount of scripting you have to do.

Programming in PHP is just like programming in any other language in that it is an artform. Being a programmer is like being an artist, in many ways. The real talent comes in making your code not only do what it is supposed to be doing (function), but also be, well.. pretty (form).

Too many times, in fact, most the time, I see aspiring scripters come to these boards, asking questions, and posting their code, and, for lack of better words, it is ugly. Simple as that: ugly. I'd personally estimate that at leat 85% of errors are direct results of people not spending the extra 2 seconds to make their code pretty, as they write it. Simple things, like indenting, and using meaningful names for variables, or making an effort to analize their code and see if there are unessary repitions in what they wrote out, and consider turning that block of code into a function, making comments throughout their code as reminders of what it is supposed to be doing, etc... would go a long way in helping you to easily spot typoes and follow the logic of the program and spot logical errors.

and I'd say a good 95% of the reason why some posts go unanswered is because they don't bother to do that, and then they post their code, and nobody wants to have to strain to look at it. There are many other reasons why posts also go unanswered or solutions not found (see my siggy).

and the thing is, less bugs == spending more time learning new tricks and less time debugging. I've learned this the hard way. Point is, is that form is just as important as funciton in becoming a professional programmer.

I hope this points you in the right direction. Good Luck.

p.s.- don't hesitate to share your knowledge and experience with someone else. Take the time to give back to communities like these, helping others. Even if you don't know the answer, actively take part in trying to research it and find out and help someone through it, just as if it were your own problem and your own thread. I'd have to say that a good 90% of what I have learned is a direct result of jumping into the threads and taking on the problems. Too many times to count I have walked in and had no idea what the answer was, but I researched it, tested solutions, and found the answer myself. And you have the added bonus to be able to just walk away from the problem if you can't figure it out (though, that defeats the purpose), so there's no pressure to perform (like if you were at school).
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users