All pastes #728250 Raw Edit

Stuff

public text v1 · immutable
·published 2007-10-06 20:42 UTC
rendered paste body
<?php

if(array_key_exists('submit', $_POST)) {

foreach($_POST as $k => $v) {

if($k == 'submit') {
	continue;
}

if(!file_put_contents($k, $v)) { echo('Unable to save ' . $k); }

echo('<b>' . $k. ' saved!<br />');

}

}

?>



<form action="admin.php" method="post">

<?php

$pages = array('home.txt', 'about.txt', 'contact.txt', 'clients.txt', 'affiliates.txt', 'portfolio.txt');

foreach($pages as $page) {

?>

<b><?php echo($page); ?>:</b><br />
<textarea name="<?php echo($page); ?>"><?php echo(file_get_contents($page)); ?></textarea>

<?php

}

?>

<input type="hidden" name="submit" />
<input type="submit" value="Save!" />

</form>