Jump to content

MySQL Database & Rich Text Editor


GhostHunterGeneral

Recommended Posts

Hi all,

      Can anybody help. I have buit a very simple CMS in dreamweaver which I am pretty proud of, it's nothing too special but it suits my needs. However I have noticed a really annoying problem that I have been trying for weeks to sort out but have had no luck with.

 

Basically, when I add say an article to the CMS, it submits all ok and adds it to the database, however when I displays it on the public page, characters such as quotation marks, question marks, hyphens and apostrophes display all strange.

For example the word "It's" will turn out as "It’s"

 

Can anyone lend me a hand and explain in simple terms what is happening here because it never happened in my last CMS that i built.

 

Also, does anyone know how I could intergrate a Rich Text Editor into a form such as the form below?:

 

<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
        <table align="center">
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">Chapter Name:</td>
            <td><div align="left">
              <input type="text" name="name" value="" size="32" />
            </div></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">Website URL:</td>
            <td><div align="left">
              <input type="text" name="url" value="http://www." size="32" />
            </div></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right" valign="top">Short Description:</td>
            <td><div align="left">
              <textarea name="desc" cols="50" rows="5"></textarea>
            </div></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">Country Flag:</td>
            <td><div align="left">
              <select name="image" id="image">
                <option value="" >Select Image</option>
                <?php buildImageList("../images_chapters/"); ?>
              </select>
            </div></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right"> </td>
            <td><input type="submit" value="Add Chapter" /></td>
          </tr>
        </table>
        <input type="hidden" name="MM_insert" value="form1" />
      </form>

 

 

If anyone is able to give me a few pointers or help in anyway, I would be very thankfull as it will stop me pulling chunks of hair out ;)

Thanks very much.

Neal

Link to comment
Share on other sites

You are having encoding issues. You (usually) have to set the charset the same everywhere. Its not a simple problem.

 

There is:

* The database encoding

* PHP's internal encoding

* PHP's output encoding

* The encoding that you save your document as

* The encoding that you set in the head of your document

 

...and a few others even.

 

I can try to help you (I program Japanese websites which are a headache to get all the charsets correct for). First, is it the static text on your pages that is coming through garbled, or is it dynamic text that is coming out of a database?

Link to comment
Share on other sites

Thanks so much for your reply.

 

The text that is playing up is dynamic text. The static text is totally fine.

I am finding this odd because I have built this site the exact same way as another simple CMS that I built about a year ago, the only change is that i am using dreamweaver CS3 instead of Dreamweaver 8??

 

Cheers,

Neal

Link to comment
Share on other sites

Thanks for your help.

 

I managed to figure it out after you suggestion.

I changed the charset from:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /

to:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

 

That has seemed to fix the problem!

 

Once again, thanks ever so much for your help.

 

Neal

Link to comment
Share on other sites

No worries. Glad you managed to get it working! Charsets are a huge pain in the butt. Japanese charsets are even more of a hassle! I had hours and hours and hours of headaches trying to figure out how to get them to work. I eventually figured it all out, but it wasn't easy.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.