stripslashes()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
akjackson1
Forum Newbie
Posts: 18
Joined: Mon Apr 14, 2008 9:08 am

stripslashes()

Post by akjackson1 »

Hi,
I am using TinyMCE to edit a html that has the text for the main page, the only problem is, it puts slashes all through it, I tried the stripslashes() but I can't seem to get it to work. here is what I have:

Code: Select all

<?php
$fp = fopen('../index_text.html', 'w+');
stripslashes($elm2);
fwrite($fp, $elm2);
fclose($fp);
header('Location: index.php');
?>
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: stripslashes()

Post by WebbieDave »

Change line 3 to:

Code: Select all

$elm2 = stripslashes($elm2);
For more info, check out:
http://us.php.net/manual/en/function.stripslashes.php
User avatar
akjackson1
Forum Newbie
Posts: 18
Joined: Mon Apr 14, 2008 9:08 am

Re: stripslashes()

Post by akjackson1 »

Thanks, but I figured out a different way, I used php.ini to disable it...
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: stripslashes()

Post by WebbieDave »

Good job.
Post Reply