How to pick up inputs with jquery and ajax

Asked

Viewed 162 times

1

I am with the following doubt I have a web application I want when logging into the homepage "index.html" take the 'name' and 'email' and put with jquery in another page 'paginaprincipal.html' .

for example: index.html

   <form name="form-login" id="MyForm">
        <input id="email" type="text" name="email" required>
        <input id="senha" type="password" name="senha" required>

        <button type="submit" id="btnLogin">Acessar</button>
   </form>

paginaprincipal.html

<div id="pega">
      Nome: <p id="nome"></p>
      Email: <p id="nome"></p>
</div>

note: before the main page I still have two more previous pages


Example: I have an index with login that is working with ajax and php: inserir a descrição da imagem aqui

a page between index and main

and finally I have my main page where I want to go back to the login data of the index.html inserir a descrição da imagem aqui

  • One way to do this would be to store the values in cookie, take a look at this answer here: https://stackoverflow.com/a/1599367/6101515

  • so I don’t understand what my php verifica_login.php would look like and this Calback msg == ok... Success: Function(msg){ if(msg=='ok'){ $("#retorno_log"). html(msg); Else{ window.location.href='home_page.php'; } } could be clearer as I’m still a beginner in web programming

  • the file verifica_login that I suggested, would select in the database to see if the user typed the information correctly, I will update my answer to help you.

  • right in the waiting buddy

  • updated but appeared in another answer, I do not understand. Anyway, I saw that Juniornunes gave an answer exactly about what you asked. If I were to save information on another page, I would save it using php session. Still need?

  • Alan, please do not use the response area to post add-ons or new questions. Use this comment area here, or edit your question (unless you already answered and the edit invalidates the existing answers).

  • Ok is my first question on forum rsrs

  • Possible duplicate of How to take data from a form from another page. Although this is older, the new one is better formatted.

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.