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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:12:41+00:00 2026-06-13T21:12:41+00:00

I generate this in a view: <form method=post> <input type=hidden name=test value=<?=htmlentities(‘<>&ščé’, ENT_QUOTES, ‘UTF-8’)?>>

  • 0

I generate this in a view:

<form method="post">
       <input type="hidden" 
              name="test" 
              value="<?=htmlentities('<>"&ščé', ENT_QUOTES, 'UTF-8')?>">
       <input type="submit>
</form>

Now, should I do this when processing data from the form?

$decodedTest = html_entity_decode($_POST['test'], ENT_QUOTES, 'UTF-8');

I think that this should be allright:

$decodedTest = $_POST['test'];

But I have not found a reference to this.

EDIT: I had printed the posted value of test and I had seen that the value is not encoded. What I don’t know is If I can rely on this behaviour and why. I am asking about theory of operation. If I look into the raw post request, I can see that the post data is urlencoded (which is I guess a different type of encoding than htmlentities does). Does that mean that client must perform some recoding before sending the request. Does (client) browser store input values in encoded form or decoded form in memory before sending? (I already know that php automatically decodes urlencoded data in requests so that part is fairly clear to me).

  • 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-13T21:12:42+00:00Added an answer on June 13, 2026 at 9:12 pm

    You don’t really need a reference because printing htmlspecialchars($_POST['test']) (or just setting Content-Type: text/plain) will immediately reveal that the data inside $_POST is not entity-encoded.

    You also don’t need to call htmlentities to encode the data in the view — htmlspecialchars will suffice if your aim is to generate valid markup.

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

Sidebar

Related Questions

I am trying to generate such HTML <form action=/some/process method=post> <input type=hidden name=foo.a value=aaa/>
In Zend framework 2, when I use the view's formRow method like so $this->formRow($form->get('product_name'));
In a View, code like this will generate the right URL to jump to
I am trying to generate a UITextField in a view like this. I don't
I wanted to generate a list view using below code. But after running this
I have this in my controller. I need my view to generate some HTML,
I want to embed an HTML input form (search bar) in /View/Layouts/default.ctp (which is
I have the following code for my login view: <?php echo $session->flash('auth'); echo $this->Form->create('User',
So I have a ViewBag.Something and this data is randomly generated. In my view,
How can I generate this HTML using Jade <a class=btn btn-primary btn-large data-toggle=modal href=#websiteModal>

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.