Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7488655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:00:27+00:00 2026-05-29T15:00:27+00:00

I have a form. This form will submit data to 2 different pages. After

  • 0

I have a form. This form will submit data to 2 different pages. After submit data to hidd.php I will redirect user to index.php. At the same time after submit data to hidd.php, data will be submitted to ns.php. I don’t want to wait for output from both page just quickly redirect user after submit data to hidd.php. So that was the question, how to redirect user without waiting for output after submit. Why I want to do this? It’s a long story, I even thought about using curl >> Send php variable to two pages

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>Example</title>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
function submitForm() {
    $.ajax({
        type:'POST', 
        url: 'hidd.php', 
        data:$('#ContactForm').serialize(), 
});

        $.ajax({
        type:'POST', 
        url: 'ns.php',
        data:$('#ContactForm').serialize(), 
});


    return false;
}
    </script>
</head>

<body>
<form id="ContactForm" onsubmit="return submitForm();">
    Your subdomain: <input type="text" name="subdomain" value="" /><br /> 
    Your ns1: <input type="text" name="ns1" value="" /><br /> 
    Your ns2:<br /> <input type="text" name="ns2" value="" />
    <br /><br /> 
    <input type="submit" name="submit" value="Submit" /><br />
    <div class="form_result"> </div>
</form>

</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:00:29+00:00Added an answer on May 29, 2026 at 3:00 pm

    You can use the $.post method. I’m not sure the structure of your php files but you can handle the posted data however you like.

    html change from:

      <form id="ContactForm" onsubmit="return submitForm();">
            Your subdomain: <input type="text" name="subdomain" value="" /><br /> 
            Your ns1: <input type="text" name="ns1" value="" /><br /> 
            Your ns2:<br /> <input type="text" name="ns2" value="" />
            <br /><br /> 
            <input type="submit" name="submit" value="Submit" /><br />
            <div class="form_result"> </div>
        </form>
    

    to:

    <form id="ContactForm">
        Your subdomain: <input type="text" name="subdomain" value="" id="subDomain" /><br /> 
        Your ns1: <input type="text" name="ns1" value="" id="ns1" /><br /> 
        Your ns2:<br /> <input type="text" name="ns2" value="" id="ns2" />
        <br /><br /> 
        <input type="button" name="submit" value="Submit" id="submitButton" /><br />
        <div class="form_result"> </div>
    </form>
    

    the javascript:

     $(document).ready(function(){
            $('#submitButton').click(function(){
            var subDomain = $('#subDomain').val();
            var ns1 = $('#ns1').val();
            var ns2 = $('#ns2').val();
                $.post('hidd.php', {
                    subDomain : subDomain,
                    ns1 : ns1,
                    ns2 : ns2
                });
                $.post('ns.php', {
                    subDomain : subDomain,
                    ns1 : ns1,
                    ns2 : ns2
                }, function(){
                   location.href="index.php";
                });
    
            });
        });
    

    changing the button from a submit to a button will stop the automatic redirect so you don’t have to return false. Then you are free to redirect when you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html form on DNN website. This form will submit data to
I am trying to have a JavaScript form submit its data to a different
I have a windows form simply like this: 1) a button when clicked will
I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',
I have a form in which user inputs its data along with its image.
I have this form in my view: <!-- Bug (extra 'i') right here-----------v -->
I have this form: <form name=customize> Only show results within <select name=distance id=slct_distance> <option>25</option>
I have this form. Basically what I want is to send a auto-response with
I have this form for inputting the birthday in html. But I only have
I have a form like this: <form name=mine> <input type=text name=one> <input type=text name=two>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.