Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="" method="POST">
- <input type="hidden" value="<?php csrf_field();;?>" id="token">
- <input type="text" name="txtcorreo" id="idtxtcorreo" value="">
- <input type="submit" name="Login" value="Identificarse" id="Registro" >
- </form>
- $("#Registro").click(function () {
- var dato = $("#idtxtcorreo").val();
- var route = "http://localhost/MacAltia/public/Login";
- var token =$("#token").val();
- $.ajax({
- url: route,
- headers:{'X-CSRF-TOKEN'}
- type: 'POST',
- dataType: 'json',
- data: {genre: dato}
- })
- });
- Route::post('Login', "ControladorSistema@Login");
- public function Login(Request $request) {
- if($request->ajax()){
- echo "hay ajax";
- }else{
- echo "no hay";
- }
- }
Add Comment
Please, Sign In to add comment