Jump to content

Recommended Posts

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?
Link to comment
https://forums.phpfreaks.com/topic/10819-the-next-step/
Share on other sites

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).
Link to comment
https://forums.phpfreaks.com/topic/10819-the-next-step/#findComment-40461
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.