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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:48:31+00:00 2026-06-17T02:48:31+00:00

I have a form with a text box that posts data to a php

  • 0

I have a form with a text box that posts data to a php file that uses the function “htmlentities” to make it safe to email to the website owner.

The problem is that someone managed to get a hyperlink in the text and htmlentities() does not remove it.

This is my textbox html:

<input name="usertext" type="text" />

This is my PHP code that receives the post data (I left the email code out because that’s not the problem. I changed it to just echo the received data so I could try to replicate what the hacker did. If I know how he did it, I can find a way to stop it from happening):

echo trim(htmlentities($_POST["usertext"], ENT_QUOTES));

Now the hacker send some data and this was the result html (the source code – that means it showed a normal link in the browser):

<a target="_blank" href="mailto:nyjfvw@fbjgzy.com">nyjfvw@fbjgzy.com</a>

I thought that htmlentities() would always stop anyone from being able to enter html of any kind. If I enter a hyperlink such as:

<a href="aaa" />

I get:

&lt;a href="aaa" /&gt;

But the hacker’s text was not encoded like that.

So my questions are:

  1. How did the hacker enter html tags so that the htmlentities() function did nothing to it?
  2. How would I replicate it for testing? (could be answered by above question)

I did some research and it might be possible that the hacker encoded his text in utf-7 or something?

I have already received a few emails with these same links. This hacker is obviously testing my website to see if he can do XSS or something.

  • 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-17T02:48:32+00:00Added an answer on June 17, 2026 at 2:48 am

    Nice question! I think you can read this link that explain the problem and gives a solution.

    The proposed solution is to specify to the browser (through a meta tag) which charset is used in the page.

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

Sidebar

Related Questions

I have a C# form that has a text box that needs to constantly
I have a form in which i have a text box for email and
I have 2 pages : page1.php : - has a form with text box
I have a form with one text box that is part of a div
i have form where i have text box value and link (add). when user
i have a text box on my form. I want to write 0x31 as
I have created a simple text input box that will be used to fetch
I have a PHP form that I've set up with a POST method. When
I have a form with a text input box which displays similar entries to
I have the following login form: <!-- login box --> <form action=php/login.php method=POST id=signin>

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.