A
A
Anatoly Yashenkin2014-12-10 13:20:09
PHP
Anatoly Yashenkin, 2014-12-10 13:20:09

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

2 answer(s)
R
RJs45, 2014-12-10
@RJs45

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.
It will not work only if on that site, when logging in, it is checked from which site the request came from.

O
Orkhan Jafarov, 2017-04-11
@krainoff99

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 question

Ask a Question

731 491 924 answers to any question