...

View Full Version : text format in php



Snitz
03-30-2007, 10:16 AM
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

$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?

Nightfire
03-30-2007, 10:28 AM
stripslashes() (http://php.net/stripslashes)

Snitz
03-30-2007, 10:33 AM
How do I use it?
It's very complicated for me, I swear.


$quote=mysql_real_escape_string(nl2br,stripslashes($_POST['quote']));

Is that it?

Snitz
03-30-2007, 10:34 AM
^^ I don't think that worked!

Nightfire
03-30-2007, 10:47 AM
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

Snitz
03-30-2007, 10:54 AM
You mean like this?


<?php echo"".stripslashes($quote)."" ?>

I don't think it'll work that way!

Snitz
03-30-2007, 10:55 AM
It worked that way!
That's alot nightfire.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum