Click to See Complete Forum and Search --> : I'm torn between using objects or not.


Scaught
08-15-2006, 06:37 PM
Soon I'm going to start coding the initial functions for registration/login for my board system, and I'm unsure on whether or not I should be using objects. Everything I have a hard time doing with objects I could accomplish in minutes with just normal programming. I know one of the reasons I would want to use objects is their ability to help with expansion, but it still doesn't seem like enough to convinve me to learn objects and implement them. From what I understand, I tried making a simple class for registration (http://boards.pealed.org/register.php). That page would be used in conjunction with a registration form.

It would be awesome if one of you who is more experienced could possibly disect my code, and show me what I'm doing that isn't right, or isn't the proper way of doing things. You wouldn't believe how hard it is to find documentation for learning objects in PHP.

Basically my question is, would it be worth it in the long run to learn them (I'm almost positive it is, but you know)?

chazzy
08-15-2006, 06:55 PM
it is. do it.

sitehatchery
08-15-2006, 08:28 PM
You wouldn't believe how hard it is to find documentation for learning objects in PHP.

PHP 5 has dramatically improved object handling. But, not a lot of hosting companies are using it, I'm told because of problems they've run into with some of the major PHP web applications. I think that as hosting companies and the developer community roll over to PHP's improved object handling with the newer version, we should see more tutorials and other web references.

Know however, that if you go to Barnes and Noble and look at the PHP section, most of what is there is related to PHP 5.0. So, I suggest that you look for a book. Or, someone here may have a good online resource for you.

NogDog
08-15-2006, 08:50 PM
It probably wouldn't hurt to look for any non-language-specific object-oriented tutorials, as one of the important things for using O-O PHP is understanding the whys and wherefores of using O-O techniques in general.

bokeh
08-16-2006, 02:51 AM
# checks the domain of an email for validity
function validateEmailDomain($email){
# define all the variables
$email = $this -> email1;

# split the email into $username and domain
list($username, $domain) = split("@", $email);

if(checkdnsrr($domain, "MX")){
return true;
}else{
return false;
}
}Get rid of that. Its just a waste of time and resources. Don't you know an MX record is not a requirement to receive mail? RFC 2821 section 5 (http://www.faqs.org/rfcs/rfc2821)