Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel send data with a redirect

window.location.href = "/thanks?status="+result.status+"&id="+result.id;

//or ajax

                $.ajax({
                        headers: {
                            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                        },
                        url: "{{url('/thanks')}}",
                        type: "POST",
                        data:  {"id" : result.id,"status":result.status},
                        success: function(data){
                            console.log("ajax called succesfully");
                        }

                    });
 
PREVIOUS NEXT
Tagged: #laravel #send #data #redirect
ADD COMMENT
Topic
Name
5+7 =