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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:41:28+00:00 2026-06-03T07:41:28+00:00

EDIT: I think I’ve worked something out. – This character – ’ – seems

  • 0

EDIT: I think I’ve worked something out. – This character – ’ – seems to be breaking it. If I use a ‘regular’ apostrophe (') it appears to work fine, if I replace every snazzy apostrophe in it with a regular one, it submits just fine. So, next question: why does that fancy apostrophe break CodeIgniter or PHP? I will presume this is a CI bug, but please correct me if I’m wrong. Anyway, here’s the question I originally posted, I would still appreciate some insight into why this is happening and if there’s much I can do about it:


I’m tearing my hair out over this one. This is completely bizarre and I simply cannot work it out.

Firstly, I have a basic form:

<?php $attributes = array('class' => 'form1'); $selected="";
echo form_open('admin/edit_page/'.$page->row('id'), $attributes); ?>

    <div>               
        <?php echo form_error('title'); ?>
        <label>Page Title:</label><input type="text" maxlength="100" name="title" value="<?php echo $page->row('title');?>" />
    </div>

    <div class="textarea">
        <?php echo form_error('content'); ?>
        <label>Page Content:</label><textarea name="content"><?php echo $page->row('content');?></textarea>
    </div>

    <div class="no">
        <input type="submit" value="Submit"/>
    </div>

</form>

Next, I have the corresponding CI function:

function edit_page($id)
{
    $this->form_validation->set_rules('title', 'Title', 'trim|required|max_length[50]');
    $this->form_validation->set_rules('content', 'Content', 'trim|required');

    // If validation has failed...
    if ($this->form_validation->run() == FALSE)
    {
        $data['page'] = $this->gallery_model->get_page($id);

        $this->load->view('admin/header');
        $this->load->view('admin/editpage', $data);
        $this->load->view('admin/footer');
    }
    else    // Validation successful
    {
        $title = $this->input->post('title');
        $content = $this->input->post('content');
        $this->gallery_model->edit_page($id, $title, $content);
        redirect('admin');
    }

}

All OK so far, yes? Here’s where the crazy problem begins.

  • I can ‘manually’ type in any data I like into the Content field. I click Submit, all works as expected – the database is updated with my new data, all is good in the world.
  • I can copy and paste 15 paragraphs of Lorem Ipsum or whatever into the field just fine. Hit submit, hooray.
  • However: – I am trying to copy-paste the content from the client’s site, specifically this page: http://jeremywebbphotography.com/biog.php – I am updating his site since my web dev skills have improved much since then. Here’s where things go weird – upon hitting save after copy-pasting that, the form reloads, I get the error “The Content field is required”, and my copy-paste into the field disappears.
  • If I run WebKit Inspector on Network mode and capture the form submission request, I can clearly see my copy-pasted text in the $_POST array…
  • However, if I begin my edit_page function with die("Content is ".$_POST['content']); – IT HAS CLEARED ITSELF. The output literally says “Content is “. That’s all.
  • The above works as expected with the title field – it only affects content.
  • I fathomed there might be some funny special characters or something causing this to happen in the copied contents (even though there isn’t) – but if you copy-paste it, then delete everything up until the first word ‘Biog’, then submit (so you are literally submitting one line), the same thing still happens!.

WTF is going on?!

Things I have confirmed it is not:

  • My browser (latest Chrome Dev on Mac OS X Snow Leopard – tried in Safari and Firefox, same problem)
  • CI XSS Filtering or Security Sanitising – turned these all off, no luck
  • CI Form Validation. I’ve turned it off as well.
  • The data I’m submitting (kind of) – see final descriptive bullet point.
  • Also tried running htmlspecialchars and htmlentities via the Form Validation rules, no cigar.

Thanks for your help. To clarify, here’s a screenshot of how I’m copy-pasting it:

How I'm copy-pasting

(Nothing complex there, right?) – and finally, a quick screenshot of the actual page output after submission (sorry about the CSS wonks, I’m working on it):

How it looks

  • 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-03T07:41:29+00:00Added an answer on June 3, 2026 at 7:41 am

    I suggest you use the Text Helper library and use its ascii_to_entities function:

    $this->load->helper('text');
    $content = $this->input->post('content');
    $content = ascii_to_entities($content);
    

    ascii_to_entities():

    Converts ASCII values to character entities, including high ASCII and MS Word characters that can cause problems when used in a web page, so that they can be shown consistently regardless of browser settings or stored reliably in a database. There is some dependence on your server’s supported character sets, so it may not be 100% reliable in all cases, but for the most part it should correctly identify characters outside the normal range (like accented characters).

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

Sidebar

Related Questions

Edit: I think I've figured out how to do the binary data part. Double
EDIT: This question was initially too general, I think. So What I really need
Edit: I think this has been answered successfully, but I can't check 'til later.
EDIT: I think i asked something really wrong over here, and i am sorry.
Edit: I think I can boil it down to: I want to use windows
Edit I think there is some confusion, I am not using both of the
I think my eclipse's ctrl+clicking links might benefit greatly... Edit: I'm using eclipse PDT.
EDIT: I used, finally, inotify. As stefanB says, inotify is the thing to use.
Code as reference: http://jsbin.com/aboca3/2/edit In this example above (thank you SLaks) I am truncating
EDIT: I think it's a problem on the subquery on the LINQ-generated query, it

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.