Show HTML Source Not Webpage

Discussion in 'PHP' started by GrassR00ts, Sep 8, 2007.

  1. #1
    Hello All

    Iam trying to figure out a small problem. In a program I have now here

    echo "Id: $id - Name: $name - Email: $email - Category: $category - Package: $package - Date: $date <br><h1>$title</h1><br>$article<br>$article2<br>$article3<br>$status<br><HR>";

    The $article variable is actually posting the html as a website. I want it to show the html source.

    Have any of you done this before or have seen a tutorial?

    Thanks!
     
    GrassR00ts, Sep 8, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    echo "Id: $id - Name: $name - Email: $email - Category: $category - Package: $package - Date: $date <br><h1>$title</h1><br>". htmlspecialchars($article) . "<br>$article2<br>$article3<br>$status<br><HR>";
    
    PHP:
    www.php.net/htmlspecialchars
     
    nico_swd, Sep 8, 2007 IP
  3. GrassR00ts

    GrassR00ts Active Member

    Messages:
    614
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Hey Way to be Nico

    I really appreicate it!
     
    GrassR00ts, Sep 8, 2007 IP