Code (php):
function register($register_data) {
array_walk($register_data, 'array_sanitize');
$register_data['password'] = md5($register_data['password']);
$fields = '`' . implode('`, `', array_keys($register_data)) . '`';
$data = '\'' . implode('\', \'', $register_data) . '\'';
mysql_query("INSERT INTO `users` ($fields) VALUES ($data)");
email($register_data['email'], 'Activate your account', "Hello " . $register_data['first_name'] . ",\n\nYou need to activate your account, so use the link below:\n\nhttp://localhost/www/mxxm/activate.php?email=" . $register_data['email'] . "&email_code=" . $register_data['email_code'] . " \n\n-mxxm-");
}
?>
function register($register_data) {
array_walk($register_data, 'array_sanitize');
$register_data['password'] = md5($register_data['password']);
$fields = '`' . implode('`, `', array_keys($register_data)) . '`';
$data = '\'' . implode('\', \'', $register_data) . '\'';
mysql_query("INSERT INTO `users` ($fields) VALUES ($data)");
email($register_data['email'], 'Activate your account', "Hello " . $register_data['first_name'] . ",\n\nYou need to activate your account, so use the link below:\n\nhttp://localhost/www/mxxm/activate.php?email=" . $register_data['email'] . "&email_code=" . $register_data['email_code'] . " \n\n-mxxm-");
}
?>
Želim da mi i dalje $register_data bude array, ali ne želim da radim array_sanitize . to radim na drugi način.
Jel mogu samo umesto :
array_walk($register_data, 'array_sanitize');
da napišem:
$register_data = array();
?
Nisam još uvek skockao sve skripte pa ne mogu da proverim. :( pliz.
reseno..
[Ovu poruku je menjao CiM0beTa dana 21.07.2012. u 22:34 GMT+1]