ciao a tutti ho questo script che mi legge il contenuto di un file di testo (testo.txt) e me lo visualizza in una textarea in modo da poterlo modificare e poi tramite il tasto invia lo salvo
1- andate qui http://www.nextart.it/public/scrivere/1.swf per vedere il contenuto del file di testo caricato in un file flash
2- andate qui http://www.nextart.it/public/scrivere/pannello.php
user e psw: freedemo
e vedrete il testo comparire nelal textarea.
3- provate a modificarlo (oppure) premete anche solo invia
compaiono le barre e il file flash non legge piu'....
il problema e' che se cliccate su invia vedrete che inserisce le barre \ prima delle virgolette e questo mi rende poi irrecuperabile il testo da un file flash.codice:<?php $username = "freedemo"; $password = "freedemo"; $viaForm = (md5(@$_POST["username"]) == md5($username) && md5(@$_POST["password"]) == md5($password)); $viaCookie = (md5(@$_COOKIE["username"]) == md5($username) && md5(@$_COOKIE["password"]) == md5($password)); $scadenza = time()+600; if ($viaForm) { setcookie("username", $_POST["username"], $scadenza); setcookie("password", $_POST["password"], $scadenza); } if ($viaCookie) { setcookie("username", $_COOKIE["username"], $scadenza); setcookie("password", $_COOKIE["password"], $scadenza); } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </style> <title>Scrivere su un file di testo</title> </head> <body> <?php if ($viaForm || $viaCookie) { if (isset($_POST["article"])) { $fp = fopen("testo.txt", "w+"); fwrite($fp, $_POST["article"]); fclose($fp); } $myText = file_get_contents("testo.txt"); ?> <form method="post"> <textarea name="article" cols="75" rows="10"><?php echo $myText; ?></textarea> <input type="submit" value="Invia" /> </form> <?php } else { ?> <form method="post" action=""> <label>username<input type="text" name="username" /></label> <label>password<input type="password" name="password" /></label> <input type="submit" name="Submit" value="Entra" /> </form> <?php } ?> </body> </html>
perche' mi inserisce le barre? come risolvere?
grazie a tutti..

Rispondi quotando