1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Basic News Page Upload

Discussion in 'PHP' started by johneva, Aug 20, 2010.

  1. #1
    Hi

    I have been working on getting a basic news system added onto a site but having troubles. I have made the upload form, form process script and display page and it works, well sorta.

    The news is uploading to the database fine but when I go to display it on the display page all single quotes in the news article get replaced with a square symbol, also any line breaks get lost in the system also.

    Whats the correct way to go about doing this?

    Cheers
    John Eva
     
    johneva, Aug 20, 2010 IP
  2. BackOfTheNet

    BackOfTheNet Peon

    Messages:
    344
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you inserting into a TEXT Data Type?
     
    BackOfTheNet, Aug 20, 2010 IP
  3. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is the charset for the page the same as the data you are uploading? Also, you can use the php nl2br() function to convert linebreaks to <br />s.
     
    exam, Aug 20, 2010 IP
  4. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #4
    Na I was insrting into a varchar using UTF 8 in the pages for the website upload page and display page, an also for the database.
     
    johneva, Aug 23, 2010 IP