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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:03:37+00:00 2026-06-08T20:03:37+00:00

I have a JS script in HTML file which collects input provided by a

  • 0

I have a JS script in HTML file which collects input provided by a user. Using the inputed values I form a string and send it to backend Python script via an AJAX call:

$.ajax({
                type: "POST",
                url:  "/cgi-bin/backend.py",
  });              data: { 'form_data' : datastring}

The datastring has a value like:

age=9&country=US&buyer=Sample

I see in FireBug the same getting POSTed as:

form_data=age%3D9%26country%3DUS%26....

In my Python backend code I have a check to validate and get the CGI ‘form_data’ variable value:

        if self.cgi.has_key ("form_data"):

But surprisingly the code does not enters this ‘if’ code? Also how does the values in the datastring gets changed to ‘age%3D9%26’? If I split the CGI variable by ‘&’ and the parse the splited values by ‘=’ will I be able to get the CGI name value pairs?

  • 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-08T20:03:39+00:00Added an answer on June 8, 2026 at 8:03 pm

    First of all the data your sending is getting urlencoded and that is why it looks that way.

    You will also need to post your python code if you need any more help with this question. That aside I would advice you to use a python web framework such as Flask or bottle instead of using cgi.

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

Sidebar

Related Questions

I have an html file which passes values into a java servlet to insert
I have an index.php-file, which will echo the string with the returned .html-file prepared
I have a script in PHP which removes empty paragraphs from an HTML file.
I have an upload script that write a index.html file, I modified it to
I have a PHP script (index.php) that includes an index.html file in a sub-directory
I have an HTML file containing these lines - <script>PrintFileURL("13572_BranchInformationReport_2012-06-29.xml","13572_BranchInformationReport_2012-06-29.zip",0,"184277","Jun 29 1:30","/icons/default.gif")</script> <script>PrintFileURL("13572_BranchInformationReport_2012-07-02.zip","13572_BranchInformationReport_2012-07-02.zip",0,"184302","Jul 2
I have this code in a .html.erb file: <script src=http://connect.facebook.net/en_US/all.js#xfbml=1></script> <script> FB.Event.subscribe('edge.create', function(response) {
I have the following in a html.erb file: <%= @location_list = [['test',2]] %> <script
I'm trying to have a script automatically transform an xml file into several html
Within my HTML, I have a php script that includes a file. At that

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.