Ciao. È da un sacco che non posto più niente e da ancora più che non codo niente, ma mi è ripresa un pizzico di voglia e (tempo permettendo per studiare) vorrei riprendere. E quindi cosa ho fatto? Mi sono messo a creare un rudimentale NoPaste, così tanto per riprenderci la mano. Solo che non mi funziona (IE mi dice che c'è un errore nel codice, ma non lo trovo).
nopaste.php
Vi chiedo aiuto (e scusatemi per la lunga assenza, ora voglio tornare a fare casino su questo forum xD).
nopaste.php
PHP:
<html>
<head>
</head>
<body>
<?php
$author=htmlentities($_POST['author']);
$title=htmlentities($_POST['title']);
$lang=htmlentities($_POST['language']);
$code=htmlentities($_POST['code']);
$name=$author+$title+(string) rand(0, 1000)+'.html';
while (file_exists($name)) {
$name=$author+$title+(string) rand(0, 1000)+'.html';
}
$file=fopen($name, 'w');
fwrite($file, '<html>
<head>
<title>'+$title+' by '+$author+'</title>
</head>
<body>
Linguaggio: '+$lang'+'<br>
Codice: <div>'+$code+'</div>
</body>
</html>');
fclose($file);
header('Location: '+'http://localhost/'+$name);
?>
</body>
</html>