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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:46:25+00:00 2026-06-07T10:46:25+00:00

My question is similar to this question but I’m not using code igniter. I’m

  • 0

My question is similar to this question but I’m not using code igniter. I’m echoing variables obtained from a database into the value attribute of a text input. The variables may contain ‘ or ” or any other special chars.

I tried:

<input type="text" name="myTextInput" value="<?= htmlspecialchars($dbValue, ENT_QUOTES); ?>" />

but it outputs quotes as &quot; or &#039; which is not what I want. I want the text input to actually contain the quotes as typed by the user.

should I be using a php function or a javascript function to escape the string? if I don’t escape it I get a javascript error because the quotes inside the $dbValue string are interacting with the value attribute quotes.

  • 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-07T10:46:27+00:00Added an answer on June 7, 2026 at 10:46 am

    You’ll want to use html_entity_decode. Here’s an example for the documentation:

    <?php
    $orig = "I'll \"walk\" the <b>dog</b> now";
    
    $a = htmlentities($orig);
    
    $b = html_entity_decode($a);
    
    echo $a; // I'll &quot;walk&quot; the &lt;b&gt;dog&lt;/b&gt; now
    
    echo $b; // I'll "walk" the <b>dog</b> now
    ?>
    

    Reference: http://www.php.net/manual/en/function.html-entity-decode.php

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

Sidebar

Related Questions

Note: This is similar to this question but it is not the same. I
I have checked this similar question, but the suggestions did not solve my problem:
This question is similar to this question but not quite the same. Can I
This question is similar to this one (but not exact): Count immediate child div
I have a question very similar to this one but the answer does not
My question is similar to this , but creating junction table is not good
My question is similar to this one but for Mercurial (converting using cvs2hg ).
this is a question similar to this one . But I am not good
I have asked a question similar to this in the past but this is
My question is similar to this one but none of the answers solve my

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.