SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    illegal ********* immigrant
    Join Date
    Jul 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    htmlentities() problem

    Hey there,

    I am trying to get htmlentities to work in that code:

    PHP Code:
    ...
    elseif (isset(
    $_GET['edit_now']))
            {
                
    $titre htmlentities(addslashes($_POST['titre']));
                
    $titre_r mod_rewrite_this($_POST['titre']);
                
    $text htmlentities(addslashes($_POST['text']));
                
    $id addslashes($_POST['id']);
                
                if (empty(
    $titre) OR empty($text) OR empty($id)) 
                { 
                    echo 
    "<span style=\"color:red;\">Assurez vous d'avoir bien rentr&eacute; tous les champs requis, &eacute;chec de l'ajout.</span>";
                }
                else
                {
                    echo
    '<p><b>id:</b>';
                    
    var_dump($id);
                    echo
    '</p><p><b>Titre:</b>';
                    
    var_dump($titre);
                    echo
    '</p><p><b>Titre_r:</b>';
                    
    var_dump($titre_r);
                    echo
    '</p><p><b>Text:</b>';
                    
    var_dump($text);
                    echo
    '</p>';
                    
    $sql mysql_query("UPDATE sections SET titre='$titre', text='$text', titre_r='$titre_r' WHERE id='$id'") or die(mysql_error());
    ... 
    I never had any problem before with the htmlentities function so I have no idea what's wrong.

    Please help.
    Thank you!

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what makes you think something is wrong?

  3. #3
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    What exactly is going wrong?

  4. #4
    illegal ********* immigrant
    Join Date
    Jul 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol...

    htmlentites() isn't working, it does not convert latin caracter into there respective html entities

  5. #5
    illegal ********* immigrant
    Join Date
    Jul 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    found the problem thx.


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
  •