php name _GET name content file_get_contents name if _POST content_ _P

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<?php
$name = $_GET['name'];
$content = file_get_contents($name);
if($_POST){
$content_ = $_POST['name'];
$fp = fopen($name, "w+");
fwrite($fp, $content_);
fclose($fp);
header("Location: /pony.php?name=".$name);
}
echo "
<form method='post'>
<textarea name='name' cols='30' rows='6'>".$content."</textarea><br/>
<input type='submit'>
</form>
";