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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:19:34+00:00 2026-05-25T22:19:34+00:00

When I use <form method=post enctype=text/plain action=proc.php> form data can not be sent to

  • 0

When I use

<form method="post" enctype="text/plain" action="proc.php"> 

form data can not be sent to proc.php file properly. Why? What is the problem? Why I can’t use text/plain encoding with post but I can use it with get method?

  • 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-25T22:19:34+00:00Added an answer on May 25, 2026 at 10:19 pm

    [Revised]

    The answer is, because PHP doesn’t handle it (and it is not a bug):

    https://bugs.php.net/bug.php?id=33741

    Valid values for enctype in <form> tag are:
    
    application/x-www-form-urlencoded
    multipart/form-data
    

    The first is the default, the second one you need only when you upload files.

    @Alohci provided explanation why PHP doesn’t populate $_POST array, but store the value inside a variable $HTTP_RAW_POST_DATA.

    Example of what can go wrong with text/plain enctype:

    file1.php:

    <form method="post" enctype="text/plain" action="file2.php">
    <textarea name="input1">abc
    input2=def</textarea>
    <input name="input2" value="ghi" />
    <input type="submit">
    </form>
    

    file2.php:

    <?php
    print($HTTP_RAW_POST_DATA);
    ?>
    

    Result:

    input1=abc
    input2=def
    input2=ghi
    

    No way to distinguish what is the value of input1 and input2 variables. It can be

    • input1=abc\r\ninput2=def, input2=ghi, as well as
    • input1=abc, input2=def\r\ninput2=ghi

    No such problem when using the other two encodings mentioned before.

    The difference between GET and POST:

    • in GET, the variables are part of URL and are present in URL as query string, therefore they must be URL-encoded (and they are, even if you write enctype="text/plain" – it just gets ignored by the browser; you can test it using Wireshark to sniff the request packets),
    • when sending POST, the variables are not part of URL, but are sent as the last header in HTTP request (POSTDATA), and you can choose whether you want to send them as text/plain or application/x-www-form-urlencoded, but the second one is the only non-ambiguous solution.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a simple registration page: <?php $firstName = $_POST['firstName']; ?> <form action=registration.php method=post
I use fileuploader Jquery, I tried to form defined as follows: <Form enctype="multipart/form-data" action="<%:Url.Action("Edit","Ticket")%>"
If I use the ImageShack API just in a form like this: <form method=post
I am using a plain text file in a PhP script. Is there any
I have a simple JSP that contains checkbox and submit button: <form action=MappingSubmit.jsp enctype=multipart/form-data
Is there a way to use form fields that does not correspond to database
I'm trying to use resteasy 2.0.1.GA to upload a form with a file in
I have a file uploader on my website, since i cannot use php I'm
I'm trying to use the JQuery Form plugin (http://jquery.malsup.com/form/) to upload a file and
I get the source codes of a web form in which use 'post' methos

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.