If installing pear looks difficult, then just don’t use it. It’s probably not something for total beginners.
Validation of email address is a difficult topic. What if the syntax is correct but the address itself is wrong? Like when a user types wrong letter in their own email address, even though it looks valid, the email sent to that address will bounce.
That’s why it’s pretty common practice to send some type of activation link in order to confirm that user actually received your initial email.
Even after you validated the address and user confirmed, sometimes emails start bouncing back like when someone’s mailbox becomes full or maybe person leaves the company and they disable his account.
This means that you need to either periodically keep sending validation links or have a program that detects bounced emails. this is not an easy thing to do since this goes beyond php.
Anyway, good luck to you. I would also suggest you learn to use some type of framework like Zend, it has lots of code already written like email validation, and has classes for creating and processing web forms. It will take some time to learn but then will make your job easier.
Validation of email address is a difficult topic. What if the syntax is correct but the address itself is wrong? Like when a user types wrong letter in their own email address, even though it looks valid, the email sent to that address will bounce.
That’s why it’s pretty common practice to send some type of activation link in order to confirm that user actually received your initial email.
Even after you validated the address and user confirmed, sometimes emails start bouncing back like when someone’s mailbox becomes full or maybe person leaves the company and they disable his account.
This means that you need to either periodically keep sending validation links or have a program that detects bounced emails. this is not an easy thing to do since this goes beyond php.
What about e-commerce sites like Amazon? They don’t validate or activate your username which is an e-mail address. (Seems like they should, but I guess they don’t want to slow down the checkout process!)
Anyway, good luck to you. I would also suggest you learn to use some type of framework like Zend, it has lots of code already written like email validation, and has classes for creating and processing web forms. It will take some time to learn but then will make your job easier.
I’d rather learn from scratch and just learn what I need versus a whole framework.
It sounds like people either love things like Zend or they hate it.
I don’t know how Amazon doing it but it’s sure not in php. I think they do send you account activation email. Maybe then have a way to detect bounced email right away.
Sure, learn the whole php from scratch.
Pear is not easy for beginner because not all hosts support it, it you are on shared webhost, you have a choice to ask your host, maybe they already have it installed (not, it’s not the part of php)
Also pear has command line utility called pear which is usually a part of php, but it’s just a simple shell program that you use for installing individual pear pachages.
There are instructions on pear website about how to install it on your home PC, on Windows on Linux, on shared host, on dedicated host. It’s pretty involved process.
In my opinion Zend is easier to learn than pear because it’s written pretty much by the same team, where pear classes come from all over the world, even though they have coding standard, the classes are still very different. Also I find many pear classes are outdated and don’t work with php 5.3 at all, where with Zend the situation is much better.
I think it is easier to just look for any chars followed by an @, more chars followed by a . and more chars and be done with it.
If someone phonies out an email address like me@me.com, it will pass all validators.
/.+@.+\\..+/
Super simple.
My main contact form has no validation for email and have never had any issues (That I know of).
You can alternatively download PEAR packages individually in zip files, they are generally just a bunch of php classes in a folder which you unzip and include in order to carry out a discrete task.
As long as you add the package into a folder nominated in your include path you will find them easy enough to use.
Your include path will usually contain the path /PEAR in any case, if not just add the folder yourself.
The drawback of not using the PEAR installer is that the package is not automatically updated when a new version is released - you have to discover and carry out this upgrade yourself.
It does provide an easy way of getting to know how Pear works though.