how to configure PHP path

I’m learning Ajax form process. what’s my problem is When I submit a form it works and redirect to another page. on that page when I clicked back button from browser. I don’t redirect to previous page. if you give me an idea I can try . please help

 <form  id="form-admin-login">
   <input name="username" type="text" placeholder="User name" class="input-field" required="">
   <input name="password" type="password" placeholder="Password" class="input-field" required="">
   <button name="submit" onClick="submit_login()" class="btn btn-login">Login</button>


function submit_login(){
        type: "POST",
       data: $("#form-admin-login").serialize(),
        url: "ajax/ajax-admin-login.php",

        dataType: "json",
        cache: false,


        success: function(data) {


            else if (data['error']==1)



        error: function(jqXHR, textStatus, errorThrown){


this how I process the form

Source: ajax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.