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

  • Home
  • SEARCH
  • 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 8953779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:10:31+00:00 2026-06-15T14:10:31+00:00

I have a form, example: <form method=post action=some external URL> <input type=hidden id=id name=session_id

  • 0

I have a form, example:

<form method="post" action="some external URL">
    <input type="hidden" id="id" name="session_id" />
    <input type="hidden" id="val1" name="val1"  />
    <input type="hidden" id="val2" name="val2" />
    <input type="submit" value="Send" />
</form>

I need to save this data into mySQL before sending it into “some external url” – let’s say that my “saving to database” script is on “script/save” url. How can I transfer my data there before sending it throught this form?

EDIT

It would be nice, when my form will only be sent to “some external url” when the “script/save” gives POSITIVE RESPONSE.
Could you help me with that too?

  • 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-06-15T14:10:32+00:00Added an answer on June 15, 2026 at 2:10 pm

    Hey just use an ajax call onsubmit then submit the form when the ajax call is done

    <html>
    <head>
    <script type="text/javascript">
        function doSomething()
        {
            xmlHttp = new XMLHttpRequest();
            xmlHttp.open('GET', 'yourscript.php, true);
            xmlHttp.onreadystatechange = function(){
                if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
                    var response = xmlHttp.responseText;
                    // response is what you return from the script
                    if(response == 1){
                        alert('works');
                        form[0].submit;
                    }else{
                        alert('fails');
                    }
                }else{
                    alert('fails');
                }
            }
            xmlHttp.send(null);
        }
    </script>
    </head>
    <body>
        <form action="external-url" method="post" onsubmit="doSomething();">
            <input type="text" name="blah" id="blah">
            <input type="submit" value="save">
        </form>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following form: <form id=vintro-upload-form action={url}?nexturl={nextUrl} method=post enctype=multipart/form-data > <input name=file type=file/>
For example, I have a HTML form with several input buttons, <form action=/index.php method=post>
Example, if I have <form name=blah> <input name=1/> <input name=2/> <table> <tr> <td> <unkown
For example, in the following HTML ... <form name=outerform> <input type=text name=outer1/> <input type=text
I have this URL example.com/photo?people I want to rewrite this URL in the form
If i have a form which action should differ according to some session variable
I have an HTML form with some radio buttons like these: <form action =
I have a form (for example, abc.frm ). I want the duplicate form (for
I have a form with 3 fields (simplyfied example). The first one is a
I have an array Y of the form(it is just an example, i have

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.