Ciao,
funzionava in locale, ma appena la metto sul web mi da lo stess errore...
Saete come aiutarmi?
Il seguente è il codice:
<?php
session_start();
header("Cache-control: private");.
//-----------------------
$modifiche = $_POST["modificato"]; //testo del file
strip_tags($modifiche, '<b><u><a><i><br><?php/"/"'); //tag che mi avete consigliato
$newFile = $_POST["fileDaMod"];//richiama il "nomefile.php"
$file = $_POST["fileDaMod"];//uguale
if(!$newFile){
echo "<script>alert('Impossibile caricare il file...')</script>";
}
$new = fopen($newFile, 'w+');
$legginew = fread($new, 10000000);
//--------------------------------------------------
$container = fopen("container.php", "a+");
if(!$container){
echo "<script>alert('Errore Impossibile caricare il file.')</script>";
}
$readIt = fread($container, 10000000);
$string = "\r\n". $newFile. "<br>";
//--------------------------------------------------
// Check that we are logged in and an admin
if(@$_SESSION["permission"] == 10){
?>
<html>
<head>
<script>
function dettagli(){
var target_link = "details.php";
var w = window.open(target_link,'_blank','width=840,height=600','scrollbar=true');
}
</script>
<link rel = "stylesheet" type = "text/css" href = "style.css">
<title>Area iscritti: <?php print $_SESSION['user'];?></title>
<style type="text/css">
<!--
.Stile1 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
</head>
<body>
<script>
function dettagli(nome){
var target_link = nome;
var w = window.open(target_link,'_blank','width=840,height=600','scrollbar=true');
}
</script>
<table border = "0" cellspacing = "0" cellpadding = "0" width = "80%" align = "center" style = "height: 100%;">
<tr>
<td height = "15%">
<!--// Spacer cell -->
</td>
</tr>
<tr>
<td valign = "top" style = "border: 3px double #888888;">
<table border = "0" cellspacing = "0" cellpadding = "10" width = "100%" align = "center">
<tr>
<td width = "36%" valign = "top" style = "border-bottom: 1px solid; background: #f0f0f0;">
<span class = "bold">Bentornato <?php print $_SESSION['user']; ?> | </span><?php
// Get the user status
switch($_SESSION["permission"]){
case 1: $p = "moderatori";
break;
case 10: $p = "admin";
break;
default: $p = "utenti";
break;
}
?>
Sei nella sezione <b><?php print $p; ?></b>. </span></td>
<td width = "64%" align = "right" style = "border-bottom: 1px solid; background:;"><?php
// Print out admin links
if($_SESSION['permission'] == 10){
?>
<a href="loadPage.php">Carica / Crea</a> | <a href="#" onClick="dettagli('upload.php'); return false;">Upload file</a> | <a href = "modUser.php">Modifica User</a> | <a href = "delUser.php">Elimina User</a> | <a href="#" onClick="dettagli('details.php'); return false;">Details</a><a href="details.php"></a> |
<?php
}
?> <a href="userarea.php">Indietro</a> |
<a href = "logout.php">Logout</a></td>
</tr>
<tr>
<td colspan = "2" valign = "top" style = "padding: 20;"><form name="form1" method="post" action="modPage.php">
<?php
if(fwrite($new, $modifiche)){
fclose($new);
?>
<div align="center"><span class="Stile1">Modificato con successo!</span><br>
<?php
}else{
?>
<div align="center"><span class="Stile1">Errore durante la modifica.</span><br>
<?php
}
?>
<?php
if($newFile != "container.php" || $newFile != $file){
if(fwrite($container, $string)){
fclose($container);
?>
<div align="center"><span class="Stile1">Aggiunto al database.</span><br>
<?php
}else{
?>
<div align="center"><span class="Stile1">Errore durante la modifica del database.</span><br>
<?php
}
}
?>
<br>
</div>
</form> <p> </p></td>
</tr>
</table></td>
</tr>
<tr>
<td height = "15%"><!--// Spacer cell -->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height = "15%">
<!--// Spacer cell -->
</td>
</tr>
</table>
</body>
</html>
<?php
}
else header("location: index.php?fail=1");
?>