how to solve this problem (aprostrophy)

Discussion in 'PHP' started by dineshsingh1984, Feb 21, 2011.

  1. #1
    I' m make a admin site where enter text in input field in form, text example "I'm study with delhi univercity" where i am using aprostrophy ('). this text print in div same as but when this text I want print in input field for editing then only display first letter "I" and other text which are using after aprostrophy nothing display.

    what's problem..................
    plz give the solution...........
    plz help............................
     
    dineshsingh1984, Feb 21, 2011 IP
  2. Netratrix

    Netratrix Active Member

    Messages:
    82
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    70
    #2
    Netratrix, Feb 21, 2011 IP
  3. dineshsingh1984

    dineshsingh1984 Active Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    it's not working ???????????????
     
    dineshsingh1984, Feb 22, 2011 IP
  4. steevjohnson

    steevjohnson Member

    Messages:
    241
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    38
    #4
    If you are inserting into db, could solve
    However, try these functions
    html_entities() or htmlspecialchars() or html_entity_decode()

    You will have a solution in one of them
     
    steevjohnson, Feb 22, 2011 IP
  5. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #5
    
    echo '<input type="text" value="'.htmlspecialchars( $OLD_TEXT ).'" />';
    
    Code (markup):
    And if you see slashes alongwith quotes, use
    
    if(get_magic_quotes_gpc())
       $OLD_TEXT = stripslashes($OLD_TEXT);
    
    Code (markup):
     
    Vooler, Feb 23, 2011 IP
  6. dineshsingh1984

    dineshsingh1984 Active Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #6
    thanks, I will try
     
    dineshsingh1984, Feb 23, 2011 IP