SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Location
    BD
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile comment echo problem :(

    hello,
    I am facing a problem with echo comment . details ::

    if i write a comment on my site it will show correctly but when i create a comment like html tag it will show like HTML tag not showing like normal text.
    EXAMPLE: if i write : <input name="name" type="text"> then it is showing like a INPUT BOX but i want to show this like normal text .
    so how can i do this ?
    if you know try to help me please.

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,235
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    You need to use htmlspecialchars($comment) to get that.

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Location
    BD
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bro i am new in coding with php can u please make this clear ? it will be great help for me

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,235
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    Show me the code you have for echoing your comment and I'll show you how to update it.

    Future reference, here is the manual page http://us3.php.net/manual/en/functio...ecialchars.php

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Location
    BD
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:

    $result 
    mysql_query("SELECT * FROM inbox INNER JOIN members on inbox.frm=members.login WHERE (frm='$passkey'and tooo='$frm') or (frm='$frm' and tooo='$passkey') ORDER BY id DESC");



    while (
    $row = @mysql_fetch_array($result))
    {
    echo 
    '<img class="pp" src="'.'../account/'.$row["pp"].'" alt="s" height="30" width="30">';
    echo 
    "<div id='imgmsg' class='bar'><a href='"."../".$row["frm"]."'/>"."<strong>".$row["f_name"]." ".$row"last_nme"]."</a>"."</br>"."</strong>"."<pre>".($row["message"])."</pre>"."</div>";



  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Location
    BD
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh bro thnks i got this and its working i just use ::

    htmlspecialchars($row["message"])

    and its working. thank alot for ur idea @cpradio bro


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
  •