How to switch tabs in button click after saving data in mysql database in php?

I am new to PHP, i started developing application using php, please look into my code

index.php

[php]<?php require_once('./config.php'); ?>

<?php /* * Following code will get single product details * A product is identified by product id (pid) */ // array for JSON response $response = array(); // check for required fields if (isset($_POST['name'])) { $title = $_POST['name']; $company = $_POST['company']; require_once('./db_connect.php'); // connecting to db $db = new DB_CONNECT(); // mysql inserting a new row $result = mysql_query("INSERT INTO user(name,company) VALUES('$title','$company')"); } ?> // this identifies your website in the createToken call below Stripe.setPublishableKey("<?php echo $stripe['publishable_key']; ?>"); function stripeResponseHandler(status, response) { if (response.error) { // re-enable the submit button $('.submit-button').removeAttr("disabled"); // show the errors on the form $(".payment-errors").html(response.error.message); } else { var form$ = $("#payment-form"); // token contains id, last4, and card type var token = response['id']; // insert the token into the form so it gets submitted to the server form$.append(""); // and submit form$.get(0).submit(); } } $(document).ready(function() { $("#payment-form").submit(function(event) { // disable the submit button to prevent repeated clicks $('.submit-button').attr("disabled", "disabled"); // createToken returns immediately - the supplied callback submits the form if there are no errors Stripe.createToken({ number: $('.card-number').val(), cvc: $('.card-cvc').val(), exp_month: $('.card-expiry-month').val(), exp_year: $('.card-expiry-year').val() }, stripeResponseHandler); return false; // submit from callback }); });

Name:

Company:

Purchase a quote by Oscar Wilde today! Only $535! Limited supply and going fast, buy now!!

Card Number
CVC
Expiration (MM/YYYY) /
Buy!

Tab 3 Content Goes Here...

[/php] In Tab1 I'm saving data into database. Whenever user clicks on the save button the data needs to be saved into database and it will go to Tab2. I am successful while saving the data. My problem is it is not going to Tab2 after saving the data. When we click on the save button, the tab2 is just blinking but the page is still showing tab1 content. I want that whenever the user clicks on the save button the data needs to be saved in database and it will go to Tab2 content. Any suggestions?
Sponsor our Newsletter | Privacy Policy | Terms of Service