builders Posted February 1, 2012 Share Posted February 1, 2012 Hi i have a form that logins at a mail. I have installed an SSL at this domain and i would like to add an option at the form for the user to login using https or not the form is above. How can i add an option with check-box from user to login using https ???? IF this is checked when the user clicks "login" he will redirected to https and will login. If i have not describe well please ask for details. Thanks <form class="login-form" action="<?php echo $this->moduleBaseUrl; ?>/XXX/XXXXXX" name="loginPage" id="loginPage" method="post"> <input type='hidden' name='emailName' value=''/> <input type='hidden' name='emailDomain' value=''/> <input type='hidden' name='cssStyle' value='<?php echo $this->cssStyle ?>'/> <table class="login"> <tbody> <tr> <td> <label class="user"><?php print $this->translate('Email') ?>:</label> <input id="email" class="input-email" type="text" name="email" tabindex="1" /> </td> </tr> <tr> <td> <label class="pass"><?php print $this->translate('Password') ?>:</label> <input id="password" class="input-pass" type="password" name="password" tabindex="2" /> </td> </tr> <tr id="LoginBtn" style="display: none;"> <td> <input class="loginbtn <?php echo $this->cssStyle ?>" type="submit" value="<?php print $this->translate('Login') ?>" /> <span class="remember"><?php print $this->translate('Remember Me') ?></span> <input class="check" type="checkbox" value="1" name="RememberMe" /> </td> </tr> </tbody> </table> </form> Quote Link to comment https://forums.phpfreaks.com/topic/256201-insert-field-at-form-for-ssl-connect/ Share on other sites More sharing options...
kicken Posted February 1, 2012 Share Posted February 1, 2012 You'll have to use javascript to change the form's action parameter to the new HTTPS url when they check the box (or revert it back if they uncheck it). Posting to a non-https page then redirecting to an https url based on the checkbox would defeat the purpose of using https at all because the initial post of the login details would not be encrypted. Quote Link to comment https://forums.phpfreaks.com/topic/256201-insert-field-at-form-for-ssl-connect/#findComment-1313449 Share on other sites More sharing options...
builders Posted February 2, 2012 Author Share Posted February 2, 2012 You'll have to use javascript to change the form's action parameter to the new HTTPS url when they check the box (or revert it back if they uncheck it). Posting to a non-https page then redirecting to an https url based on the checkbox would defeat the purpose of using https at all because the initial post of the login details would not be encrypted. Is there a way when the client hit "submit" not to sent the data but to make the redirect to https and then submit the data ?? or this is not possible ?? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/256201-insert-field-at-form-for-ssl-connect/#findComment-1313649 Share on other sites More sharing options...
kicken Posted February 2, 2012 Share Posted February 2, 2012 Is there a way when the client hit "submit" not to sent the data but to make the redirect to https and then submit the data ?? or this is not possible ?? No. The only non-JS solution would be to have a link such as 'Login via HTTPS' and when the click on that link you take them to a login form over https and they can enter their details there. Or just force them to always login using https. Why even have the option? Quote Link to comment https://forums.phpfreaks.com/topic/256201-insert-field-at-form-for-ssl-connect/#findComment-1313738 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.