开发者

hooks for registration form in drupal

I am new to drupal. And want to customize drupal registration form.In that form i have added some field from profile module. Now i want to add radio button and on submitting it should go to paypal to pay . After returning successfully user will be registered for login.

some body told me it will be done through hook. But how to create this. My problems are-- 1. two radio b开发者_开发知识库uttons, one is auto selected 2. on submit go to paypal and after returning successfully save in database

I am using 6.X. any help will be appreciated.


Before going further, you may want to search if the required features is not already implemented in a contrib module.

With a hook_form_alter() implementation you can alter the registrations forms. In Drupal 6 there is two of them, one on the user/login page and the second one in the login block, so you can't use a single hook_form_FORM_ID_alter() implementation.

In your alter hook, you can add your field and add your own submit handler. Adding a submit handler allows you to redirect the user to PayPal after a successful registration. Configure Drupal to require account validation for new account. And when the user returns from PayPal, validate the account through a custom page handler.

The Pay module may probably help to handle payment processing and maybe more.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜