Ciao,

ho uno script php che inserisce del testo nel database, e con un form ho dato la possibilitā di modificarlo.
In un'altra pagina, poi, richiama la variabile che mi stampa il contenuto della textarea.
Nel momento in cui perō nel testo che vado ad inserire o a editare inserisco un apostrofo, esso non mi viene visualizzato nč nella textarea nč nella pagina che richiama la variabile.

Qui il codice, sperando in un vostro aiuto.
Grazie.

text.php
codice:
<?php 
error_reporting(E_ERROR | E_WARNING | E_PARSE);
require_once('../conf.php'); 
if (isset($_POST[edit])){
$sql = "UPDATE `pagine` SET `testo` = '$_POST[testo]'";
mysql_query($sql);
}
$sql = "SELECT * FROM pagine";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
$html  = "<form method='POST' name='form' action='text.php'>\n";
$html .= "<input type='hidden' name='edit' value='$row[id]'>";
$html .= "<textarea id='textarea' name='testo'>$row[testo]
</textarea>

";
$html .= "<input id='stile' name='submit' type='submit'      value='MODIFICA'
onClick=\"window.alert('Modifica avvenuta con successo'); \"> HOME";
$html .= "</form>";
}
echo "$html";
?>
index.php
codice:
<?php             
require_once('admin/conf.php');                     
$sql = "SELECT * FROM pagine ORDER by 'id' ";              
$query = mysql_query($sql);              
while($row = mysql_fetch_array($query)) {              
$testo = "$row[testo]";
$text = nl2br ($testo);
}
echo $text;
?>
conf.php
codice:
<?php
$db_host = "localhost";
$db_name = "demoform";
$db_user = "root";
$db_pass = "";
mysql_connect($db_host, $db_user, $db_pass)or die(mysql_error()); 
mysql_select_db($db_name) or die(mysql_error()); 
?>

<?php
$user= 'admin';
$pass= 'admin';
?>