Drupal 6 - Secure a Webform with SSL in mixed-mode while maintaining a positive user experience

Securing a webform is easy using a module such as Session 443 or Secure Pages but what about scenarios where a user abandons the form and browses the site using the primary or secondary menu. If you don't have the menu interaction planned out correctly they could end up receiving insecure content warnings and may even abandon the site altogether. Another scenario is when a user submits the form, do they continue to a confirmation page in SSL mode? This too can create problems with the user receiving insecure content warnings. Drupal's API makes it possible for UX professionals to create the best user experience. So below are a couple snippets for Drupal 6 that will solve these specific use cases with no additional modules. These snippets assume you have secured your webform with Session 443 or Secure Pages modules but theirs no dependencies on either.

First lets look at the first function that will alter the primary menu links. This function is called "THEME_NAME_menu_item_link($link)" and needs to be placed in "template.php" in your theme folder. Replace THEME_NAME with the name of your theme. This function defines the navigation menus, and route page requests to code based on URLs.

<?php
function THEME_NAME_menu_item_link($link) {
global $base_path;

Subscribe with RSS Subscribe to RSS - Session 443