Ho provato ha creare un form per portale tramite txt, il problema e che non so come mai non vada ecco i codici usati:
form.html
è qui penso tutto ok,Codice HTML:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Invia.php</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <FORM METHOD="post" ACTION="salva.php"> <p> </p> <p> </p> <table align="center"> <tr> <td colspan="2" align="center"> Nik<INPUT TYPE="text" NAME="autore"></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> <td> Page:<br><textarea name="testo"></textarea> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="sub" value="Invia"><input type="reset" name="res" value="Cancella"> </td> </tr> </table> <p> </p> </form> </body> </html>
ora salva.php
Qua da questo errore:Codice PHP:<?
$dir = "Pagina/";
$text = isSet($_POST['autore']) ? $_POST['testo'] : '';
// levo i backslash
$text = stripslashes($text);
$text = htmlspecialcharts($text);
$text = nl2br($text);
$fp = fopen($dir.$nome."Pagina.txt", "w");
fwrite($fp, " Text: ".$Text);
fclose($fp);
echo"Pagina creata con successo";
?>
Fatal error: Call to undefined function: htmlspecialcharts() in /membri/ang/prove/Creazione_pag/salva.php on line 8
htmlspecialcharts() mi server per i javascript percio preferirei non fosse tolta.
Home.php dove lo voglio stampa:
Qua da questo errore;Codice PHP:<?
$file = file("Pagina/Pagina.txt");
foreach($file as $riga) {
$words = explode(' ' , $text);
for($i=0 ; $i<count($words) ; $i++) {
// Link
$word[$i] = trim($word[$i]);
$var = isset($word[$i]{0}) ? strtolower($word[$i]{0}) : '';
$var .= isset($word[$i]{1}) ? strtolower($word[$i]{1}) : '';
$var .= isset($word[$i]{2}) ? strtolower($word[$i]{2}) : '';
$var .= isset($word[$i]{3}) ? strtolower($word[$i]{3}) : '';
if(trim($var) == 'http') {
$word[$i] = '<a href="'. word[$i] .'">'. $word[$i] .'</a>';
} elseif(trim($var)=='www.') {
$word[$i] = '<a href="http://'. word[$i] .'">'. $word[$i] .'</a>';
}
// Grassetto
$words[$i] = str_replace('[b]','<b>',$words[$i]);
$words[$i] = str_replace('[/b]','</b>',$words[$i]);
// Corsivo
$words[$i] = str_replace('[i]','<i>',$words[$i]);
$words[$i] = str_replace('[/i]','</i>',$words[$i]);
// Sottolineato
$words[$i] = str_replace('[u]','<u>',$words[$i]);
$words[$i] = str_replace('[/u]','</u>',$words[$i]);
// Immagini
if( strpos( $words[$i], '[img]' ) !== false && strpos( $words[$i], '[/img]' ) !== false) {
$link = str_replace('[img]','',$words[$i]);
$link = str_replace('[/img]','',$link);
$words[$i] = "<img src=\"$link\">";
}
}
$text = implode(' ', $words);
print($riga);
}
?>
Parse error: syntax error, unexpected '[' in /membri/ang/prove/Creazione_pag/Stampa.php on line 14
Qua non capisco xd.
Ora vi spiego la pagina stampa mi serve per far si che quando scrivo href=link. esca il link se qualcuno puo aiutarmi plllss.

LinkBack URL
About LinkBacks

