Results 1 to 8 of 8

Thread: Bullet point question in PHP vs HTML page

  1. #1
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Bullet point question in PHP vs HTML page

    Two pages:

    http://www.kishwaukeecollege.edu/ath...yer.php?id=309

    http://www.kishwaukeecollege.edu/ath...r.shtml?id=309

    The PHP doesn't show the bullet in my database field but the .shtml file does. Is there anyway to make the PHP page show the bullet point?

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    try encoding the bullet instead of entering the character directly in the code: •

    post your php code if you need more help

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You can automatically convert characters using htmlentities() as well. (Look any function up on php.net for examples/usage).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33 View Post
    You can automatically convert characters using htmlentities() as well. (Look any function up on php.net for examples/usage).
    Unfortunately, this didn't help. I have a bullet point in the database just copied over from a Word document, so no special code or anything.

    When I put in the HTML code for bullet, &bull; and use the htmlentities(), it reads it as &bull;. Without the htmlentities, it shows up as a bullet point. However, I don't want to go into my database and change the bullet point that's already in there to the HTML code. That would be a lot of work!

    Is there something special or different about why a .shtml page will read this item in the database and the .php page won't?

  5. #5
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by lindsaycb View Post
    ... just copied over from a Word document, so no special code or anything.
    That's probably your problem; maybe something to do with character encoding. Replacing the bullet with the appropriate html entity ( &bull; ) would be your best solution.
    Last edited by traq; 10-21-2009 at 01:54 AM.

  6. #6
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by traq View Post
    That's probably your problem; maybe something to do with character encoding. Replacing the bullet with the appropriate html entity ( &bull; ) would be your best solution.
    So there must be something in the HTML render vs. PHP page rendering?

    That's why in the original post, I had 2 links, one a HTML page and the other a PHP page and pulling info from the same database but the bullet shows up in the HTML page and doesn't in the PHP page. Is that correct?

  7. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I have no idea. I would think it might have something to do with the database and how things are encoded/decoded between there and php. After all, php is all server-side, it serves normal html to the browser.

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You cut and paste from word. You can use php (htmlentities, or even str_replace) to specifically fix this, or you can not use that-- not using that means you won't fix what you cut/paste from word, and you need to fix the real problem-- don't cut/paste from word.
    PHP is not the problem at all, just generating html, as traq said. The encoding of the database, the html page, and the word document must match or you will end up with strange results, though, so that might be the problem (probably is).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •