Click to See Complete Forum and Search --> : strip " \ " on sumbit ??? Help !!!!


Peuplarchie
02-14-2006, 07:32 PM
Thread closed due to double posting.
- mod

Good day,

I'm trying to edit a file in a textboxes, save it, an maybe re-edit-it after.
my problem is that "\" appear after submiting the change..

How can i strip them so that it does'nt interfear in my code ?










<?php
$file = "test.html";
if(isset($_POST['text']))
{
$handle = fopen($file, "w") or die("Unable to open file for writing");
fwrite($handle, $_POST['text']);
fclose($handle);
}

$text = "";

if(is_readable($file))
{
$text = file_get_contents($file);

}
?>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
<title>Page Title</title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--

body {
margin: 0;
padding: 1em;
background-color: #666633;
}

legend {
font-size: large;
font-weight: bold;
}
-->
</style>
</head>
<body>
<br>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<fieldset>
<legend><input type="submit" value="Sauvegarder"></legend>
<textarea class="zz" name="text" id="text" cols="130" rows="30" ><?php echo htmlspecialchars(stripslashes($searchtext)); ?><?php echo $text; ?></textarea>
</fieldset>
</form>
</body>
</ht