开发者

How to create a drupal user with out email address?

I want to create a Drupal user account without an email开发者_运维百科 address. How can I create that? If I write a custom query which tables do I have to insert values in? Or does Drupal have a built-in function for that?

I have only user's first name, last name, password details. I want to create a user with only this information.


This will work, even email is required:

$newUser = array(
  'name' => 'your username',
  'pass' => 'any password', // note: do not md5 the password
  'status' => 1,
);           
user_save(null, $newUser);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜