Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jul 2004
    Location
    Lebanon
    Posts
    223
    Thanks
    6
    Thanked 0 Times in 0 Posts

    text format in php

    www.darkquote.com visit it please and see how the quote #36 is looking

    It feels like I\'m looking at life
    Through a telescope
    Because I\'m so high

    How can I get rid of the "\" ?

    This is the code of the quote line
    PHP Code:
    $quote=mysql_real_escape_string(nl2br($_POST['quote'])); 
    And one more thing, the quote #36 should be quote #1, if I went to phpmyadmin and reset it to 1, will it start counting from 1?

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts

  • #3
    Regular Coder
    Join Date
    Jul 2004
    Location
    Lebanon
    Posts
    223
    Thanks
    6
    Thanked 0 Times in 0 Posts
    How do I use it?
    It's very complicated for me, I swear.

    PHP Code:
    $quote=mysql_real_escape_string(nl2br,stripslashes($_POST['quote'])); 
    Is that it?

  • #4
    Regular Coder
    Join Date
    Jul 2004
    Location
    Lebanon
    Posts
    223
    Thanks
    6
    Thanked 0 Times in 0 Posts
    ^^ I don't think that worked!

  • #5
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    You put it on the variable you're outputting. Not on the one you're putting into the db.

    So whatever variable it is when it's coming out of the db, stick stripslashes around it

  • #6
    Regular Coder
    Join Date
    Jul 2004
    Location
    Lebanon
    Posts
    223
    Thanks
    6
    Thanked 0 Times in 0 Posts
    You mean like this?

    PHP Code:
    <?php echo"".stripslashes($quote)."" ?>
    I don't think it'll work that way!

  • #7
    Regular Coder
    Join Date
    Jul 2004
    Location
    Lebanon
    Posts
    223
    Thanks
    6
    Thanked 0 Times in 0 Posts
    It worked that way!
    That's alot nightfire.


  •  

    Posting Permissions

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