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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:34:37+00:00 2026-06-15T19:34:37+00:00

I have a HTML file that calls a CGI script. When I click logout

  • 0

I have a HTML file that calls a CGI script. When I click logout button, POST method sends all the fields. Is this a known bug?

Here is my Javascript code:

var request = null, session = null;
    function postEscape(val) {
        return encodeURIComponent(val).replace(/%20/g, "+")
    }



    function submit_logout() {
var request=null
if( !document.form.loggedIn.checked ) return
logout = new XMLHttpRequest()
logout.open("POST", "client.cgi", true /* asynchronous? */ )
logout.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
console.log("action=logout&session=" + postEscape(document.form.session.value)+"&host="+postEscape(document.form.host.value)+"&port="+postEscape(document.form.port.value))
logout.send("action=logout&session=" + postEscape(document.form.session.value)+"&host="+postEscape(document.form.host.value)+"&port="+postEscape(document.form.port.value)+"&action=logout")
form.loggedIn.checked = false

}

This is what I see in POST data:

username=&password=&host=somehost.com&port=6700&action=logout&display=++++&session=

and here is my form

<body>
<form name = "form">
<input name="username" size="25" type="text">username<br>
<input name="password" size="25" type="text">password<br>
<input name="host" size="25" type="text">host<br>
<input name="port" size="25" type="text">port<br>
<input name="login" value="Login" type="button" onclick="submit_login()"><input        type="checkbox" name="loggedIn" id = "loggedIn" onclick="this.checked=!this.checked">

<input name="action" value="logout" type="submit" onClick="submit_logout()"><br>
<textarea name="display" rows="24" cols="68">    </textarea><br>
<input type="hidden" name="session" value="">
<input name="message" size="64" maxlength="64" type="text"><input name="send"     value="send" type="button" onClick = "send()"><p></p>
  </form>
  • 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-15T19:34:38+00:00Added an answer on June 15, 2026 at 7:34 pm

    Try changing the following: You are submitting everything becayse of the type="submit" for the logout. It should be a type="button".

    <input type="button" /> buttons will not submit a form – they don’t do anything by default. They’re generally used in conjunction with JavaScript as part of an AJAX application.

    <input type="submit" /> buttons will submit the form they are in when the user clicks on them, unless you specify otherwise with JavaScript.

    <input name="action" value="logout" type="submit" onClick="submit_logout()">
    

    to

    <input name="action" value="logout" type="button" onClick="submit_logout()">  //type="button"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

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 a script that calls a php file and gets an JSON object
I have an index.html file that calls main.php which returns a json object just
I have some code that calls in a new html file, to be added
I have an HTML form that calls an ASP.NET page when a button is
I have a form in a HTML file that will post values from the
I have a CGI script pulling bibliography data from a BibTeX file, building HTML
I have one html file that calls external js file. I am presume html
I have a html file that has invoice details I would like to know

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.