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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:49:51+00:00 2026-06-10T01:49:51+00:00

I have an issue with sending POST data from my form. There is a

  • 0

I have an issue with sending POST data from my form. There is a <textarea> in the form where i’m trying to paste some data which contain a tag <script> (e.g. a code of counter for website traffic, it doesn’t matter).

<form action="/savepage" method="POST">
   <button type="submit">Save</button>
    <fieldset>
            <textarea name="content">
              Some <b>text</b>
              <script src="script_source" type="text/javascript"></script>
            </textarea>
    </fieldset>
</form>

After the form was submitted I receive the $_POST array which contains all fields of my form, but tags <script> are missing in the $_POST['content'] variable. This problem does not occur when I insert any other tags in the same field.

var_dump($_POST["content"]);

gives

string(18) “Some <b>text</b>

“

Can anybody explain me what happens with the tags <script> in the <textarea> field when submitting the form and why they are absent in the $_POST['content'] variable? The back-end of my site is on the Kohana Framework v.2.4. Perhaps it’s Kohana who cut tags… Or, maybe, is there an option in the Apacahe or PHP settings which can do this things?
Thanks in advance.

  • 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-10T01:49:53+00:00Added an answer on June 10, 2026 at 1:49 am

    If you put the <script>-tag in before, you need to encode it, so that the browser does not parse the content

    So – use htmlspecialchars():

    <form action="/savepage" method="POST">
       <button type="submit">Save</button>
        <fieldset>
                <textarea name="content">
    <?php echo(htmlspecialchars('
                  Some <b>text</b>
                  <script src="script_source" type="text/javascript"></script>'); ?>
                </textarea>
        </fieldset>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written some data fetch service which fetches some entities from main web
I have an issue. I am getting data from a MySQL database, and make
I have a basic upload form: <form method=post action= enctype=multipart/form-data > <input type=file name=logo>
I have issue with: <form:checkboxes path=roles cssClass=checkbox items=${roleSelections} /> If previous line is used
I have an issue of alphabetically sorting the contacts picked from the address book
I have an issue which I could not find answer for across the web.
I have an issue while getting the file name with out extension from a
I have a custom Http Handler which manipulates HTTP POST and GET. I got
One desktop application needs to get some services from server. For example sending some
I'm having a problem.. Actually I do have an issue when sending a value

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.