PDA

View Full Version : slash issues.


Red Blaze
11-18-2005, 02:26 PM
I'm using html files as templates rather than the database. I use a text box in a PHP file to edit the HTML templates. I type in regular HTML, but when I go back to see the text box it has a slash in before EVERY quote. It gets rather annoying as it messes up my links in those templates. I know there's a code that removes those slashes but I haven't found it. Any help would be appreciated, thank you.

TyleR
11-18-2005, 02:29 PM
$text = stripslashes($text);

Red Blaze
11-18-2005, 02:39 PM
$text = stripslashes($text);

That didn't seem to work. Here's the code I have, I may be wrong somewhere.


<?php

if($_POST['admin_nav']){
$template = $_POST['admin_nav'];
$filename = "admin_nav.htm";
}elseif($_POST['site_navbar']){
$template = $_POST['site_navbar'];
$filename = "site_navbar.htm";
}

$filePointer = fopen("../templates/$filename", "w");
fputs($filePointer,"$template\r\n");
fclose($filePointer);
$template = stripslashes($template);
?>


EDIT: Nevermind, I fixed it. I just moved the stripslashes code up 2 lines. Thank you! :)