Answer the question
In order to leave comments, you need to log in
How to embed a login form to a site from another site?
There is site1 (WP), there is site2 (asp.net mvc).
Site2 is available only after entering the login, password.
On site1, you need to place the login form (login, password, "login" button) from site2. When you click on the "Login" button, you need to get to site2 already logged in.
There is access to the site2 code, but it is very tricky and I couldn’t even make a copy of the page (((
At first I wanted to do it using an iframe, but then I realized that I would stay on site1 even if I could log in.
So I want to ask knowledgeable people how is it better to implement such a scheme and is it possible to implement it without touching site2?
Answer the question
In order to leave comments, you need to log in
In any case, the target site form has an action and a set of fields. Look at the action of that login form and what fields. Then, on your site, write a form like this:
<form action="[action из той формы]">
<input type="text" name="[name из той формы]" />
<input type="password" name="[name из той формы]" />
<submit name="[name из оригинальной формы]" value="[аналогично]">
</form>
Well, if there are still fields or attributes of the form (for example, method, enctype), then duplicate them too. Take out the variable and then add a link to it and write the variable without parentheses in the query.
var input = document.getElementById('message');
var result = document.getElementById('result');
var p_url;
input.onkeyup = input.oncopy = input.onpaste = input.oncut = (function() {
return function() {
var reg = /(http|https)(.*)/g;
var service = "http://mini.s-shot.ru/?";
var link = reg.exec(this.value)[0];
result.innerHTML = "<a href="+link+" target=\"_blank\"><div class=\"url-img\"style=\"background-image:url("+service+link+")\"></div><div class=\"linkwrap\">"+link+"</div></a><a href=\"javascript:void(0);\" class=\"remAtt\" onclick=\"f_url_close()\" data-balloon=\"Отключить\" data-balloon-pos=\"up\" ></a>";
$('#p_url').val('' + link + '');
p_url = link;
}
})();
// Тут правь
message: $('#message').val()+''+add_photo.list()+''+add_doc.list()+''+p_url
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question