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 6168611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:43:03+00:00 2026-05-23T22:43:03+00:00

how can i pass parameters from an html page(map.html) to a php(createxml.php) without having

  • 0

how can i pass parameters from an html page(map.html) to a php(createxml.php) without having to open the php page? Im incorporating googlemaps in html page(map.html) so i want the users to enter data on a form on the html page which will be sent to php(createxml.php) which in turn will connect to mySQL DB and create an xml format of the response the html page uses this xml output to create positions on the map since it contains longitude and latitude.
I have used the following code in the heading of the php page(createxml), but it shows the contents of php file for a brief moment redirecting me to map.html
Thanks for your time, i can post all the code if needed.

      <meta http-equiv="refresh" content="0;url=http://localhost/map.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-23T22:43:04+00:00Added an answer on May 23, 2026 at 10:43 pm

    It’s quite simple with AJAX, using jQuery you don’t have to know much about it 🙂
    So simply import the latest jQuery Library.

    Then you have your form:

    <form id="my_form">
    <input type="text" name="param1" />
    <input type="text" name="param2" />
    <input type="hidden" name="action" value="do_stuff" />
    <input type="submit" value="Submit" />
    </form>
    

    and somewhere beneath that, you just paste this tiny javascript-function, which handles the submit of the form:

    <script>
      $('#my_form').submit(function(){
        var post_params = $('#my_form').serialize();
        $('#waiting').show();
        $.post('the_page_you_are_on.php', post_params, function(data) {
          $('#waiting').hide();
          return false;
        })
      });
    </script>
    

    (The element (div, p…) with the id “waiting” could e.g. contain one of those fancy ajax loading images, but is not neccessary! 🙂 If you want one to be shown, find one via google, set it as the background image of the #waiting-element and set its display to none (CSS)).

    The function itself just calls the page you’re on and then you’ve got the form variables in your post-array, so the top of your page could look something like this:

    <?php
    
    if(isset($_POST['action'])) {
      switch($_POST['action']) {
        case 'do_stuff' :
          $param1 = $_POST['param1'];
          $param2 = $_POST['param2'];
    
          //do some DB-stuff etc.
        break;
      }
    }
    
    ?>
    

    I hope that helps!

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

Sidebar

Related Questions

How can we pass parameters from a Java Activity while launching another application of
Using logparser you can pass on parameters to the query you'd like to run
How to pass parameters to [WebMethod] in Asp.Net(C#) ? Can some one please explain
What's the best method to pass parameters to SQLCommand? You can do: cmd.Parameters.Add(@Name, SqlDbType.VarChar,
I'm working on a Perl script. How can I pass command line parameters to
When I submit a form in HTML, I can pass a parameter multiple times,
This is a snippet from my index.php page, where I'm displaying a menu with
Is it possible to pass parameters from template back to the script ? In
I'm trying to use an after_commit method to pass parameters from the post to
if i have a protected method, can i pass in a parameter where the

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.