Guest User

Untitled

a guest
Dec 13th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <form action="" method="POST">
  2. <input type="hidden" value="<?php csrf_field();;?>" id="token">
  3. <input type="text" name="txtcorreo" id="idtxtcorreo" value="">
  4. <input type="submit" name="Login" value="Identificarse" id="Registro" >
  5. </form>
  6.  
  7. $("#Registro").click(function () {
  8. var dato = $("#idtxtcorreo").val();
  9. var route = "http://localhost/MacAltia/public/Login";
  10. var token =$("#token").val();
  11.  
  12. $.ajax({
  13. url: route,
  14. headers:{'X-CSRF-TOKEN'}
  15. type: 'POST',
  16. dataType: 'json',
  17. data: {genre: dato}
  18. })
  19. });
  20.  
  21. Route::post('Login', "ControladorSistema@Login");
  22.  
  23. public function Login(Request $request) {
  24.  
  25. if($request->ajax()){
  26. echo "hay ajax";
  27. }else{
  28. echo "no hay";
  29. }
  30. }
Add Comment
Please, Sign In to add comment