Results 1 to 2 of 2

Thread: Stripslashes

  1. #1
    Join Date
    Feb 2006

    Question Unanswered: Stripslashes

    Hi everybody, total newbie to php... hope you can help me out.

    Ok, here's my code.... I want to remove any slashes that occur in $news


    $link_id = db_connect($defaultdbname);
    if(!$link_id) error_message(sql_error());
    $query = "SELECT id, headline, user, news FROM DMA_News ORDER BY id DESC limit 3 $order_by_str $sort_order_str";
    $result = mysql_query($query);

    echo "<table border='0' width='100%' bordercolor='#000000' bgcolor='#009900' cellspacing='0' cellpadding='0'></TBODY>";
    while($query_data = mysql_fetch_array($result)) {
    $id = $query_data["id"];
    $headline = $query_data["headline"];
    $user = $query_data["user"];
    $news = $query_data["news"];
    echo "<TR width=100%><td><font color=yellow><b><center>$headline</b></center></TD></tr><tr width=90%><TD><font color=white>$news</td></tr><tr width=90%><TD><font color=white><i>posted by - $user</i><br><hr></TD></TR>";
    //Close the clubs Table
    echo "</TBODY></TABLE></TD></TR></TBODY></TABLE>";


    Hope you can help me, thanks in advance.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    looks like you need to use some of the inbuilt functions
    stripslashes could be of use
    failing that a regular expression could be handy
    ereg, eregi, ereg_replace
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts