作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 drupal 6 中创建了一个重置密码表单。提交时我必须重定向到显示 Drupal 消息的同一页面。
我写了以下内容:
global $language;
$account = $form_state['values']['account'];
_user_mail_notify('password_reset', $account, $language);
watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
$form_state['redirect'] = 'user/password';
return;
}
但我的邮件代码工作正常,但我的消息没有显示。
最佳答案
尝试此代码,它会在同一页面上重定向您并显示消息...
$msg = "Further instructions have been sent to your e-mail address.";
drupal_set_message($msg, $type = 'status');
drupal_goto('user/password');
关于drupal_set_message drupal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15810533/
我在 drupal 6 中创建了一个重置密码表单。提交时我必须重定向到显示 Drupal 消息的同一页面。 我写了以下内容: global $language; $account = $f
我在 drupal 6 中创建了一个重置密码表单。提交时我必须重定向到显示 Drupal 消息的同一页面。 我写了以下内容: global $language; $account = $f
当用户在我的网站上注册时,我似乎无法从 drupal_set_message 收到消息。 我正在使用 Drupal 6.14。 在 user.module 中添加打印: function user_r
问题: 在 Drupal 7 的表单 API 中,当使用#AJAX 刷新字段时,验证错误消息不会显示,直到整个页面被刷新。我看到我刷新的字段在错误状态下突出显示,但用户看不到相关消息,直到为时已晚(他
在 Drupal 中打开弹出窗口 api ajax 时,如何清除由 drupal 设置消息生成的消息队列? 最佳答案 Drupal 5-8:运行 drupal_get_messages()将清除消息。
我是一名优秀的程序员,十分优秀!