file non modificabili

luigi777

Utente Attivo
14 Feb 2008
1.086
1
38
43
Massa, Italy
Ciao, vorrei sapere come fare un in_array sui file che non voglio che posso essere modificati dall'utente.
il codice per adesso è questo:
PHP:
if ($action == "modifica")
{
if(isset($_POST["submit"]))
{
	$postedValue = stripslashes($_POST["strContent"]);
	
if(empty($postedValue))
{
  $error = "Non hai inserito nulla";
}else
{

		file_put_contents("../".basename($strUrl)."", $postedValue); 
		$msg ="<a href='pages.php'>Torna indietro</a>";
  }
}
?>

<?php 
if (file_exists("../" .$strUrl."")) {
?>
<?php	if ( isset ( $error ) )	{ echo '			<p class="error">' . $error . '</p>' . "\n";	}	?>
<?php	if ( isset ( $msg ) )	{ echo '			<p class="msg">' . $msg . '</p>' . "\n";	} else {//if we have a mesage we don't need this form again.?>

<form method="post" action="?action=modifica&url=<?php echo basename($strUrl); ?>">
<div align="center">
<textarea name="strContent" cols="100" rows="30">
<?php
	$temp = file_get_contents("../".$strUrl.""); 
	echo htmlspecialchars($temp);
  ?>
</textarea>

<p><input type="submit"  value="Modifica" name="submit" onClick="return confirm('Sicuro di confermare?');"/></p>
</div>
</form>	
		
<?php
}
	

} else {
			
			echo "The file $strUrl does not exist";
			}
}

come posso fare?

grazie mille.
 

Discussioni simili