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!
// Set Attribute Function
Function __set($name, $value) {
// Check if password submitted, and md5 it
if ($name == "Password") {
$value = md5($value);
}
$this->$name = $value;
}
I know __set and __get are php5 only, but how would you achieve something similar in PHP4, I'd assume to write another function to take the place of this, and call it rather than implicitly run it like I did in 5?
Err... if you don't have the magic functionality associated with __set and __get, then you're going to have to create alternative paths for it: I don't see why you need this code.