S
S
Sasha Brahms2015-11-12 14:36:26
PHP
Sasha Brahms, 2015-11-12 14:36:26

running js from php?

When authorizing, you need to get data from js (geolocation data) and write them to the database, how to implement this?
the authorization form is sent to \user\signin, there is no view, no AJAX request...
How to implement it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaliy Orlov, 2015-11-12
@Dlike

you get geo-data before submitting the form, and add it to the authorization form with a hidden field
; if this is not possible (for example, the frontend is a separate service to which you do not have access), then you authorize by showing it an additional "transition" page, on which there will be a progressbar , and ajax is sent to you in the background, after which you redirect it further from this page using js or submit a form with hidden fields that already have the info you need.

A
Andrey Sokolov, 2015-11-12
@eX1stenZ

AJAX.
In this case, when running JS, there will be a call to PHP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question