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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:05:49+00:00 2026-06-02T02:05:49+00:00

I am using CodeIgniter and on an edit form its pulling in data from

  • 0

I am using CodeIgniter and on an edit form its pulling in data from the database. Sometimes this data contains apostrophes, ampersands etc..

How can i get CI to not parse this and change it to HTML version so end users can edit it.!

This is an image of the edit form, this text field has data pulled in from the database and populated into the input text field. The data does not contain any special chars as you can see in the second image below.

enter image description here

Here is a screenshot of how the data looks in the table, note i am only pulling from the far right column. Not the 4th column:
enter image description here

As you can tell the data isnt being stored as html converted, yet CI is still converting it.

Here is a snippet of the above text field:

<?php    
/**
 * Form Field attribute settings
 * @author Mike DeVita
 */
$companyname = array(
    'name'  => 'companyname',
    'placeholder' => 'Enter Your Companies Name',
    'id'    => 'companyname',
    'value' => set_value('', $points['pointFields']['companyname']->uf_fieldvalue),
    'maxlength' => 80,
    'size'  => 30
);
            <div class="_100">
                <p><?php echo form_label('Company Name', $companyname['id']); ?><?php echo form_input($companyname); ?></p>
                <?php echo form_error($companyname['id']); ?>
            </div>

Here is a snippet of the insert to database:

function addUserFieldHtml($compiledHtml){
    foreach ($compiledHtml as $cHK => $cHV){
        $data = array (
            'pointid' => $cHV['pointId'],
            'timestamp' => time(),
            'html' => $cHV['html'],
            'fieldid' => $cHV['fieldId'],
            'fieldvalue' => $cHV['fieldValue']
        );
        $this->db->insert('userfields', $data);

    }
}#end addUserFieldHtml() function

Thanks

  • 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-02T02:05:50+00:00Added an answer on June 2, 2026 at 2:05 am

    The issue is here:

    $companyname = array(
        'value' => set_value('', $points['pointFields']['companyname']->uf_fieldvalue),
    );
    

    set_value() converts some characters to entities, and should only be used in raw HTML – not passed to any of the form helper functions, like so:

    <input name="email" value="<?php echo set_value('email'); ?>">
    

    This will call the form_prep() function which escapes the input string, something like this:

    <input name="username" value="<?php echo form_prep($row->username); ?>">
    

    So just change your config for value to this:

    $companyname = array(
        'value' => $points['pointFields']['companyname']->uf_fieldvalue,
    );
    

    …and when used with form_input() or any of the other form helper functions for displaying an input, the value will be escaped properly for you. For example:

    echo form_input('myinput', '</div>"someJunkInput"<?php'); // Good to go
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Codeigniter framework and I have a form with input fields. When
I am using codeigniter and its pagination class. It works perfectly and it looks
I'm using CodeIgniter with CodeIgniter sessions that are stored in a MySQL database. I
I'm using jQuery to call a method of my volunteer CodeIgniter controller from a
I am having an add/edit form to update and add to database, and I
I want to submit a form using jQuery in a CodeIgniter application. However, the
I am using Codeigniter and I am trying to call info from two tables:
I'm using CodeIgniter's Active Record and my code is: $current_balance = $this->get_campaign_balance($click_report['campaign_id']); $campaign_ledger =
My form validation isn’t using the rules in a config file in CodeIgniter 2.
when creating a fairly complicated form that will be used to edit a database

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.