Last active
December 10, 2015 19:08
-
-
Save mrcave/4479282 to your computer and use it in GitHub Desktop.
5 secrets for building a powerful members-only area
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="/contact?field_92375_1015030=[first]&field_92375_1015031=[last]&field_92375_1015032=[email]">Contact us</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<$loginstatus$> | |
<$loggedin$><strong>Welcome, [first]</strong><$/loggedin$> | |
<$loggedout$><a href="/login">Click here to login</a><$/loggedout$> | |
<$/loginstatus$> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://yoursite.com/login?ReturnUrl=http://yoursite.com/members |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(function(){ | |
//Set your return URL here. It should be relative to | |
//website root and should not include domain name. | |
var return_url = "/dashboard"; | |
var current_action = $('form[name="frm"]').attr("action"); | |
if(document.location.search.length) { | |
//query string already exists so we'll just add a return URL on the end with "&" | |
var query_start = "&"; | |
} else { | |
//there's no query string yet so we'll create one with "?" | |
var query_start = "?"; | |
} | |
new_action = current_action + query_start + "ReturnUrl=" + encodeURIComponent("http://" + document.domain + return_url); | |
$('form[name="frm"]').attr("action", new_action); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment