Brajan Posted February 18, 2009 Share Posted February 18, 2009 [code=php:0] <?php $files = array("/Ny_mapp/start.php/","lagg_till_nyheter.php"); $result = count($files); $fileid = $_GET['fileid']; if(isset($_POST['submit'])) { if(!file_exists($files)) { echo "File not exist"; } elseif(!is_writeable($files)) { echo "U cannot write to the file"; } else { if(!$fp = fopen($files, 'w')) { echo "Open file: Negatuve "; } elseif(fwrite($fp, stripslashes($_POST['content'])) == false) { echo "Write to the file: Negative"; } } } //Lista filer som finns i array $files for($i = 0; $i < count($files); $i++) { echo sprintf('<a href="%s?page=meny.php&fileid=%d">Ändra %s</a>',$_SERVER['PHP_SELF'],$i,$files[$i]); echo "<br>"; } echo "Du har valt " . $files[$fileid] . ""; ?> <form method="post"> Lägg till hidden i formen. <form method="post"> <input type="hidden" name="fileid" value="<?php echo $fileid; ?>" /> <textarea name="content" rows="20" cols="50"><?php echo (file_exists($files[$fileid])) ? htmlentities(file_get_contents($files[$fileid])) : ""; ?> </textarea> <input type="submit" name="submit_save" value="save"><br> </form> Link to comment https://forums.phpfreaks.com/topic/145743-problem-with-filesystems/ Share on other sites More sharing options...
GingerRobot Posted February 18, 2009 Share Posted February 18, 2009 Not asking a question isn't usually conducive to receiving an answer... Link to comment https://forums.phpfreaks.com/topic/145743-problem-with-filesystems/#findComment-765194 Share on other sites More sharing options...
premiso Posted February 18, 2009 Share Posted February 18, 2009 Not asking a question isn't usually conducive to receiving an answer... Unless we are psychotic....errmmm psychic! Link to comment https://forums.phpfreaks.com/topic/145743-problem-with-filesystems/#findComment-765229 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.